Moving a worksheet to a new workbook when you do not know the name of worksheet

F

Fireworks99

I am trying to move 2 worksheets from 1 workbook to another where I know the
name of 1 worksheet but only have a variable with the name of the 2nd
worksheet. When I try the following.....

Sheets(Array(ThisSheetName, "Attribute Definitons")).Move

where "ThisSheetName" is the variable, i get a subscript out of range error
(9). Anyone have any thoughts on how to get around this? Thanks in advance.
 
D

Dave Peterson

I'd guess that you don't have a sheet by that name in the active workbook.

So maybe it's the variables fault (some sort of typo) or maybe you changed
workbooks???
 
G

Guest

Sheets(Array(ThisSheetName, "Attribute Definitons")).Move

Maybe you misspelled "Attribute Definitons" (Definitions ?)
 

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