ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Excel changes celle when copying ? (https://www.excelbanter.com/excel-programming/326269-excel-changes-celle-when-copying.html)

-[::::Shamran::::]-

Excel changes celle when copying ?
 
When my macro is copying cells from sheet ! to sheet2 one of my cell changes
?? In sheet1 The cell is lige this : =DATO.FORSKEL(Data!G17;Data!B17;"y") In
sheet2 after copying the result is this: =DATO.FORSKEL(Data!B7;Data!B2;"y").

My macro looks like this:

Sheets("Data").Select
With ActiveCell
Range(Cells(.Row, 18), Cells(.Row, 4)).Copy

Sheets("Beregning").Range("B4").PasteSpecial Paste:=xlAll, Transpose:=True

Regards

Jesper Rasmussen



Bob Phillips[_6_]

Excel changes celle when copying ?
 
That is presumably because the cell reference is absolute and you are
copying into a different row number.

You could modify the source formula to

=DATO.FORSKEL(Data!G$17;Data!B$17;"y")

--

HTH

RP
(remove nothere from the email address if mailing direct)


"-[::::Shamran::::]-" wrote in message
...
When my macro is copying cells from sheet ! to sheet2 one of my cell

changes
?? In sheet1 The cell is lige this : =DATO.FORSKEL(Data!G17;Data!B17;"y")

In
sheet2 after copying the result is this:

=DATO.FORSKEL(Data!B7;Data!B2;"y").

My macro looks like this:

Sheets("Data").Select
With ActiveCell
Range(Cells(.Row, 18), Cells(.Row, 4)).Copy

Sheets("Beregning").Range("B4").PasteSpecial Paste:=xlAll, Transpose:=True

Regards

Jesper Rasmussen






All times are GMT +1. The time now is 06:11 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com