Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Excell: Copy specific sheet in excel without opening Excel file

Status
Not open for further replies.

azzi2000

MIS
Jan 28, 2004
145
US

Is it possible to copy a specific sheet(SheetPrice) in excel without opening the file to another workbook. (this workbook is open)

This is what I am trying to do:
Dim WB1 As Workbook, WB2 As Workbook

Set WB1 = ActiveWorkbook 'Current One
Set WB2 = Workbooks.Open(Filename:=AnotherFile)
'-----------------------------
' This is where I am having a problem
Range(Sheets(sSheetMaster)).Copy
'------------------------------------
WB1.Activate
ActiveSheet.Paste
WB2.Close

Please advice,
Thank you.
Dré
 
Something like this ?
WB2.Sheets("SheetPrice").UsedRange.Copy Destination:=WB1.ActiveSheet

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top