VBA .Copy cell value in Excel without formula

Solved
sanchis81 Posted messages 138 Status Member -  
 toto -
Bonjour,

I used a macro that copies the content of a cell to paste it into the last non-empty row of a column.

Unfortunately, if the starting cell contains a formula, it will be the formula that is copied into the destination cell and not the value of the starting cell.

Here is my code:

Sub test()
Sheets(1).Cells(1, 1).Copy Sheets(2).Cells(65535, 1).End(xlUp)(2)
End Sub

What should I modify in this code to actually copy the value of the starting cell?
Configuration: Windows XP Internet Explorer 6.0

3 answers

m@rina Posted messages 27378 Registration date   Status Moderator Last intervention   11 561
 
Hello

Try this:

Sub test() Sheets(1).Cells(1, 1).Copy Sheets(2).Cells(65535, 1).End(xlUp)(2).PasteSpecial Paste:=xlPasteValues End Sub 


m@rina
--
No need to ask me questions in private messages...
Definitely I won't answer... The forum is made for that.
2