button gets named range

D

David Turner

Using XL2000, I use the following to grab a named range from one sheet and
paste it into another by clicking on one of several buttons:

Sub GetMeal()
Range(Mid(Application.Caller, 4)).Copy
ActiveSheet.Paste
Application.CutCopyMode = False
End Sub

I now have a need to change the names of those ranges. I tried renaming one
of them as a test, and clicking the button that worked with the 'old' range
gives me an error - Method 'Range' of object '_Global' failed.

How to fix?
 
D

David Turner

David Turner wrote
Using XL2000, I use the following to grab a named range from one sheet
and paste it into another by clicking on one of several buttons:

Sub GetMeal()
Range(Mid(Application.Caller, 4)).Copy
ActiveSheet.Paste
Application.CutCopyMode = False
End Sub

I now have a need to change the names of those ranges. I tried
renaming one of them as a test, and clicking the button that worked
with the 'old' range gives me an error - Method 'Range' of object
'_Global' failed.

How to fix?

Duh! Never mind. I forgot I had assigned cmd<rangename> to each button.
Changing to cmd<newrangename> fixed it.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top