Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
While trying to run this macro, I get this error. Any insights?
Thanks --------------------------- Microsoft Excel --------------------------- Method 'Move' of object 'Sheets' failed --------------------------- OK --------------------------- Here is the Syntax Sub CombineWorkbooks() Dim FilesToOpen Dim x As Integer On Error GoTo ErrHandler Application.ScreenUpdating = False FilesToOpen = Application.GetOpenFilename _ (FileFilter:="Microsoft Excel Files (*.xls), *.xls", _ MultiSelect:=True, Title:="Files to Merge") If TypeName(FilesToOpen) = "Boolean" Then MsgBox "No Files were selected" GoTo ExitHandler End If x = 1 While x <= UBound(FilesToOpen) Workbooks.Open FileName:=FilesToOpen(x) Sheets().Move After:=ThisWorkbook.Sheets _ (ThisWorkbook.Sheets.Count) x = x + 1 Wend ExitHandler: Application.ScreenUpdating = True Exit Sub ErrHandler: MsgBox Err.Description Resume ExitHandler End Sub |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Combining two workbooks | Excel Discussion (Misc queries) | |||
Combining Workbooks | Charts and Charting in Excel | |||
Combining several workbooks into one workbook | Excel Programming | |||
combining workbooks | Excel Worksheet Functions | |||
Combining workbooks into one????? | Excel Programming |