Using Ref edit in Add in to save to a different sheet.

C

c4clark

Hey, I have built an Add In and want to be able to save to a different sheet
than the one I opened the tool on. It keeps giving me an error: SELECT METHOD
OF RANGE CLASS FAILED. This seems odd since the REf Edit has both the sheet
and the cell in it? Any suggestions?
 
J

Jon Peltier

You have to split the sheet name from the address, and reference like

Worksheets("SheetName").Range("A2:Z50")

Also, if your code selects cells during the process (usually you should
program it not to do so), if the sheet you want isn't active or activated
first, you'll get an error using the select method, as you've found.

- Jon
-------
Jon Peltier, Microsoft Excel MVP
Peltier Technical Services
Tutorials and Custom Solutions
http://PeltierTech.com/
_______
 

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