referencing to worksheet names in macro for each new worksheet inserted

  • Thread starter Thread starter qiong
  • Start date Start date
Q

qiong

Hi

I created a code to insert new worksheets and rename them according t
values on the new worksheet itself. Say in Cell D1, i have th
worksheet name.
My question is when i want to refer to this worksheet in subsequen
coding, how should i code it?
For eg,
How should i write the ???? for Sheets("????").select? Would creatin
the a variable to store the names help?

Thanks in advance
Ken
 
After inserting your new worksheet set it's name equal to a variable.
For example


SHEETS.ADD
VWORKSHEET = ACTIVESHEET.NAME

This method works best since you don't know beforehand what the name of
a newly added worksheet may be especially if you have already added and
delete worksheets in the same workbook.



Rollin
 
Back
Top