StuLux
Well-known Member
- Joined
- Sep 14, 2005
- Messages
- 682
- Office Version
- 365
- Platform
- Windows
Hi folks, long time since I came to this board for help and many thanks to all those who have helped me in past years. I'm trying to improve my code so that instead of actually selecting a range and then pasting as values I am trying to use the following code
I believe the .Value at the end should ensure it only pastes values and not formatting etc. but when I add the .Value to my code I get "Copy Method of Range Class Failed". The code works without the .Value but pastes formulas and formatting instead of just values. What am I doing wrong?
Code:
Sheet1.Range("B2:F" & RecordCount).Cells.SpecialCells(xlCellTypeVisible).Copy Destination:=Sheets(SheetName).Range("B" & RowNumber).Value
I believe the .Value at the end should ensure it only pastes values and not formatting etc. but when I add the .Value to my code I get "Copy Method of Range Class Failed". The code works without the .Value but pastes formulas and formatting instead of just values. What am I doing wrong?