View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Graham Whitehead Graham Whitehead is offline
external usenet poster
 
Posts: 72
Default activate last worksheet in a different workbook

Perhaps the best way would be to cycle through all of the worksheets and
store the name of it in each loop. then when the loop finished you have the
name of the last worksheet in the workbook stored.

For example:

dim wsheet as worksheet
dim LastWorkSheetName as string
For Each wsheet In Worksheets
LastWorkSheetName = wsheet.NAME
Next wsheet

"Aaron" wrote in message
...
Hi

I'm trying to write a macro that will need to copy the last worksheet from
a
different workbook into the one I'm working on. The last worksheet changes
each month (ie, presently it's August 06, next month it will be September
06
etc.), so I can't refer to it by name, and don't think by index numbers.
Anyone know of a way to do this?

Thanks