
November 9th, 2004, 10:24 AM
|
|
Registered User
|
|
Join Date: Nov 2004
Posts: 1
Time spent in forums: < 1 sec
Reputation Power: 0
|
|
Selection.PasteSpecial problem
I am relatively new to Excel vba programming and have a simple macro that must have a simple fix. Can someone help me?
I want to be able to select a cell, copy its formula, select another cell and run a macro to PasteSpecial the formula's value into that cell (I plan on having it run via a Custom Macro Button (icon)).
When run the macro I recorded (see below) via Tools/Macro/Macros/PasteSpecialValues I get an error message " Run-time error '1004': PasteSpecail method of Range class failed." But when I run the macro via the shortcut key (Ctrl-n) it works just fine. Your help would be appreciated!
Sub PasteSpecialValues()
'
' PasteSpecialValues Macro
' Macro recorded 11/9/2004 by M111526
'
' Keyboard Shortcut: Ctrl+n
'
Selection.PasteSpecial Paste:=xlValues, Operation:=xlNone, SkipBlanks:= _
False, Transpose:=False
End Sub
|