Selecting a worksheet
for each ws in worksheets
if ws.codename = "Sheet1" then
ws.activate
exit for
end if
next
untested for typos, apart from that it should work except -
Note when you insert a new sheet it's codename is not updated if the VBE is
closed until the wb is saved, closed & reopened.
Regards,
Peter T
"Patrick C. Simonds" wrote in message
...
I need code to select a specific worksheet. I can not use the name on the
tab since I have code which renames the worksheet based on data input.
Currently if you look at the VBA Project the name is Sheet1(01 Jan 09). It
is the 01 Jan 09 which can change, but the Sheet1 stays consistent. So how
can I select the worksheet based on the Sheet1
|