J
Jim Thomlinson
This should be close...
dim wbkTarget as workbook
dim wksTarget as worksheet
on error resume next
set wbktarget = workbooks("MyBook.xls")
if wbktarget is nothing then _
set wbktarget = workbooks.open("C:\MyBook.xls")
on error goto 0
if wbktarget is nothing then
msgbox "Sorry you book can not be found"
else
for each wkstarget in wbktarget.worksheets
wkstarget.copy Before:=Thisworkbook.worksheets(1)
'you can rename the sheet here also if you want
next wkstarget
end if
dim wbkTarget as workbook
dim wksTarget as worksheet
on error resume next
set wbktarget = workbooks("MyBook.xls")
if wbktarget is nothing then _
set wbktarget = workbooks.open("C:\MyBook.xls")
on error goto 0
if wbktarget is nothing then
msgbox "Sorry you book can not be found"
else
for each wkstarget in wbktarget.worksheets
wkstarget.copy Before:=Thisworkbook.worksheets(1)
'you can rename the sheet here also if you want
next wkstarget
end if