Difficulties Using Copy Range Function


#1

Hello,

I am trying to copy a formula I created in cell “K3” of my spreadsheet down ten rows. The formula in cell K3 is simply “$F3-$E3”.

So for example after the program runs it should have the following formulas -

Cell(K4) - "$F4-$E4"
Cell(K5) - "$F5-$E5
Cell(K6) - “$F6-$E6”, etc.

But instead it reads the following:

Cell(K4) - "$F6-$E6"
Cell(K5) - "$F7-$E7
Cell(K6) - “$F8-$E8”, etc.


In other words it skipped two rows. Below is the code I used. Do you know why? How can I fix this?

Thanks for any help you can provide.

R/


Dim Cells As Cell

Dim cells1 As Cells = oAsposeExcelWorkSheet.Cells

Cells = cells1(“K3”)

Cells.Formula = “=$F3-$E3”

Dim range1 As Range

Dim range2 As Range

cells1 = oAsposeExcelWorkSheet.Cells

range1 = cells1.CreateRange(2, 10, 10, 1)

range2 = cells1.CreateRange(3, 10, 10, 1)

range2.Copy(range1)


#2

It’s a problem of copying overlapped ranges.
Please try the attached fix.


#3

SORRY I DONT GET WAT U TALKIN bout’Embarrassed


#4

HELLO,

I dont theres away to fix the problem that you are going through.

Thanks

Justavian