Thread: ActiveSheet
View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Graham[_3_] Graham[_3_] is offline
external usenet poster
 
Posts: 3
Default ActiveSheet

Hi,
I've set up a macro to open each of the individual cost
centres within my company,extract specified data to a
master file, and then close the individual cost centre
file again. My cost centres are set in a list in cells A1
to A145. When I reach the last cost centre on the list
(which is always named "SC.rpt") I would like to perform a
slightly different routine. I would like the macro to
either recognise that the file is the last in the list or
recognise the file name if that file happens to be open. I
was trying to use an "If" statement along the lines of ;

If ActiveSheet = "C:\My Documents\SC.rpt" Then

Any help appreciated or suggestions on better ways to
proceed.

Thanks
Graham