O
Otto Moehrbach
Excel XP & Win XP
wbFile2 and wbFDB are variables and are set to 2 open workbooks. Both have
a sheet called "Names".
I want to delete the "Names" sheet in wbFDB and copy the "Names" sheet from
wbFile2 to wbFDB.
The sheet does get deleted in wbFDB. Good!
But the last line, to copy the sheet, does not work.
Sub CopyNamesSht()
'wbFile2 is the active workbook
Application.DisplayAlerts = False
wbFDB.Sheets("Names").Delete
Application.DisplayAlerts = True
Sheets("Names").Copy After:=wbFDB.Sheets("COJDatabase")
End Sub
What am I doing wrong in the last line? Thanks for your time. Otto
wbFile2 and wbFDB are variables and are set to 2 open workbooks. Both have
a sheet called "Names".
I want to delete the "Names" sheet in wbFDB and copy the "Names" sheet from
wbFile2 to wbFDB.
The sheet does get deleted in wbFDB. Good!
But the last line, to copy the sheet, does not work.
Sub CopyNamesSht()
'wbFile2 is the active workbook
Application.DisplayAlerts = False
wbFDB.Sheets("Names").Delete
Application.DisplayAlerts = True
Sheets("Names").Copy After:=wbFDB.Sheets("COJDatabase")
End Sub
What am I doing wrong in the last line? Thanks for your time. Otto