Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi,
I have the following code working fine: Sub Macro(1) Selection.Copy Range("A5").Select Selection.PasteSpecial Paste:=xlValues, Operation:=xlNone, SkipBlanks:= _ False, Transpose:=False End Sub The problem with this code is the destination cell is hardcoded. I'd like to be able to select any cell, copy it, select any other cell (using the mouse to navigate) and PasteSpecial into that cell. When I manually select a cell, copy and run: Sub Macro(2) Selection.PasteSpecial Paste:=xlValues, Operation:=xlNone, SkipBlanks:= _ False, Transpose:=False End Sub by itself, I get the following error message: Run-time error '1004': PasteSpecial method of Range class failed. How do I get Macro(1) to work? Thanks, Peter |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
pastespecial | Excel Programming | |||
pastespecial in vba | Excel Programming | |||
PasteSpecial macro | Excel Programming | |||
vba pastespecial | Excel Programming | |||
pastespecial | Excel Programming |