R
RJH
This may be a dumb questions but here goes:
If I have 2 sheets open, is there a way to refer to the inactive sheet
without using it's name?
The problem I'm having is that this file is run locally by many people and
everybody wants to rename their file. If I use the original file name in
the macro and the file gets renamed, the macro fails.
If ActiveSheet.Name = Workbooks("XXX.xls").Sheets(1).Name Then
ActiveWorkbook.Close 'close doc sheet if date already exists
Else: 'insert sheet if new date
Sheets(1).Move Before:=Workbooks("XXX.xls").Sheets(1)
End If
Thanks in advance.
RJH
If I have 2 sheets open, is there a way to refer to the inactive sheet
without using it's name?
The problem I'm having is that this file is run locally by many people and
everybody wants to rename their file. If I use the original file name in
the macro and the file gets renamed, the macro fails.
If ActiveSheet.Name = Workbooks("XXX.xls").Sheets(1).Name Then
ActiveWorkbook.Close 'close doc sheet if date already exists
Else: 'insert sheet if new date
Sheets(1).Move Before:=Workbooks("XXX.xls").Sheets(1)
End If
Thanks in advance.
RJH