PDA

View Full Version : Solved: copy sheet to a different workbook



drawworkhome
12-06-2009, 12:06 PM
hi all, im stumped..no suprise there.
i am trying to copy a shhet from workbook a to workbook b.
this is what i have so far.

ChDir (fldr)
Set Wk = Workbooks.add
Wk.SaveAs Filename:=fldr & "\" & jobfoldername
'//create subfolders here.....................................
'Replace "Sheet1" with the name of the sheet to be copied.
Stop
Workbooks("desktoppurchaseorder3").Sheets(1).copy _
after:=Workbooks(jobfoldername).Sheets(1)

any help is appreciated!
the sheet i want to copy is hidden if that makes a difference.
e

lucas
12-06-2009, 12:27 PM
both workbooks open?

drawworkhome
12-06-2009, 12:47 PM
yes, both are open with the new workbook active

lucas
12-06-2009, 02:10 PM
I think something along these lines should work for you.

With Workbooks("desktoppurchaseorder.xls")
.Sheets("Sheet1").Copy _
After:=Workbooks("jobfoldername").Sheets(1)
End With

drawworkhome
12-06-2009, 02:37 PM
that is basically what i came up with. i am not sure why did not work.
thank you.

lucas
12-06-2009, 02:51 PM
Did you get it to work?

drawworkhome
12-06-2009, 02:54 PM
i did. this is what i used:Workbooks("desktoppurchaseorder3").Sheets("job cost").copy _
Before:=Workbooks(jobfoldername).Sheets(1)
Workbooks("desktoppurchaseorder3").Sheets("est").copy _
Before:=Workbooks(jobfoldername).Sheets(1)

i do appreciate your help. if you got the time, i posted another q on copying a sub routine from one workbook to another.....
thanks!