Home |
Search |
Today's Posts |
#8
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
These changes should work
Sub othertabs(Inv As Integer) Dim second_ws As Workbook Dim Found As Integer Dim main_ws As Workbook Set main_ws = ActiveWorkbook folder = "S:\Iashare\0Subprime\Tracking\AA\" Filename = Dir(folder & Inv & ".xls") Workbooks.Open Filename:=folder & Filename Set second_ws = ActiveWorkbook For Each ws In second_ws.Sheets Found = False For Each mn_ws In ThisWorkbook.Sheets If second_ws.Name = mn_ws.Name Then Found = True Exit For End If Next mn_ws If Found = False Then With ThisWorkbook ws.Copy after:=.Sheets(.Sheets.Count) End With End If Next ws End Sub "jln via OfficeKB.com" wrote: It is being called from another subroutine. All of the other Subroutines that i have are being passed the Inv number Call othertabs(Inv) Joel wrote: Are you calling this subroutine from another subroutine? Other tabs need the parameter Inv. Make sure you are caling the sub like main below sub main Inv = "abc" call other(Inv) end sub Joel [quoted text clipped - 38 lines] workbook is already open and it will open the 2nd work book with the tabs i need to copy from. -- Message posted via OfficeKB.com http://www.officekb.com/Uwe/Forums.a...mming/200712/1 |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Sheets("Sheet").Copy problem | Excel Programming | |||
Sheets.Copy Error in Excel 2003 - Is this a registry Problem? | Excel Programming | |||
Sheets(array(aryMySheets)).Copy problem!! | Excel Programming | |||
in VBA Sheets("mysheet").Copy Befo=Sheets(1) how do i get a reference to the newly created copy of this sheet? | Excel Worksheet Functions | |||
Sheets.copy problem | Excel Programming |