I am getting a strange thing.
Using Excel's "Record Macro" wizard, I generated the following code:
Sub Macro10()
'
' Macro10 Macro
Range("B7").Select
Selection.Copy
Sheets("Quotes Database").Select
Range("J5").Select
ActiveSheet.Paste
End Sub
If I then run Macro10 it works fine.
However, if I go to Developer on the Ribbon and then insert a rectangular command button and assign the same code to it, then when I click on the button, an error 1004 is generated.
If I insert a regular shape and assign the code, the macro works OK.
Why does it not work for the inserted command button?
Does anyone know what is going on? Can you replicate this? I'm using 2007.
Thanks,
MikeG
Using Excel's "Record Macro" wizard, I generated the following code:
Sub Macro10()
'
' Macro10 Macro
Range("B7").Select
Selection.Copy
Sheets("Quotes Database").Select
Range("J5").Select
ActiveSheet.Paste
End Sub
If I then run Macro10 it works fine.
However, if I go to Developer on the Ribbon and then insert a rectangular command button and assign the same code to it, then when I click on the button, an error 1004 is generated.
If I insert a regular shape and assign the code, the macro works OK.
Why does it not work for the inserted command button?
Does anyone know what is going on? Can you replicate this? I'm using 2007.
Thanks,
MikeG