mduff
07-16-2007, 06:09 PM
Hi all,
Please see the code below I have 2 questions one is that the sheet name Expedia_Today_IDP[1].xls can change to Expedia_Today_IDP(something else) it is an export form a web site but will always have Expedia_Today_IDP in it is there a way to tell the code to activate the sheet called Expedia_Today_IDP*.xls * being any characters after the Expedia_Today_IDP
The second question is after I have the sheet open I am trying to copy the contents of the whole sheet it and paste in an other workbook I thought I had the copy down in the part in bold but it keeps giving errors (please see the part in bold)
Any help would be appreciated and please let me know if you need any more information
thanks
Workbooks("Expedia_Today_IDP[1].xls").Activate
ActiveSheet.Cells.Select.Copy _
Destination:=Workbooks("Expedia_IDP.xls").Sheets("Expedia Today IDP") _
.Range("A1:A3") Workbooks("Expedia_Today_IDP[1].xls").Close
Workbooks("Expedia_IDP.xls").Activate
Range("A1:A3").Select
Edited 24-Jul-07 by geekgirlau. Reason: insert line breaks
Please see the code below I have 2 questions one is that the sheet name Expedia_Today_IDP[1].xls can change to Expedia_Today_IDP(something else) it is an export form a web site but will always have Expedia_Today_IDP in it is there a way to tell the code to activate the sheet called Expedia_Today_IDP*.xls * being any characters after the Expedia_Today_IDP
The second question is after I have the sheet open I am trying to copy the contents of the whole sheet it and paste in an other workbook I thought I had the copy down in the part in bold but it keeps giving errors (please see the part in bold)
Any help would be appreciated and please let me know if you need any more information
thanks
Workbooks("Expedia_Today_IDP[1].xls").Activate
ActiveSheet.Cells.Select.Copy _
Destination:=Workbooks("Expedia_IDP.xls").Sheets("Expedia Today IDP") _
.Range("A1:A3") Workbooks("Expedia_Today_IDP[1].xls").Close
Workbooks("Expedia_IDP.xls").Activate
Range("A1:A3").Select
Edited 24-Jul-07 by geekgirlau. Reason: insert line breaks