Mark,
Thanks for getting me started. I've tried your suggestion.
I'm being prompted to select folder, but it does not proceed to copy
sheet(9) from all spreadsheets.
Any idea why?
Thanks, BAC
Mark Ivey wrote:
> Give this a go...
>
> Sub Combine()
> Dim Fpath As String
> With Application.FileDialog(msoFileDialogFolderPicker)
> .AllowMultiSelect = False
> If .Show = False Then Exit Sub
> Fpath = .SelectedItems(1)
> End With
>
> fName = Dir(Fpath & "*.xls")
>
> Do While fName <> ""
> Workbooks.Open Fpath & fName
> Sheets(9).Copy
> after:=Workbooks("Master1.xls").Sheets(Workbooks("Master1.xls").Sheets.Count) Workbooks(fName).Close savechanges:=False fName = Dir Loop End Sub"bac" <(E-Mail Removed)> wrote in messagenews:(E-Mail Removed)...> Presently it opens a specific folder, and pulls sheet 9 of all> spreadsheets into a new spreadsheet called Master 1. I would like for> the user to select the folder, rather than having a specific path> identified in the macro.>> This is the Macro I would like to change.> Sub Combine()>>> Fpath = "C:\home\xxxxxxxxxxxxx\xxxxxxxx\4010\" ' change to suit> your directory> fName = Dir(Fpath & "*.xls")>> Do While fName <> ""> Workbooks.Open Fpath & fName> Sheets(9).Copy>after:=Workbooks("Master1.xls").Sheets(Workbooks("Master1.xls").Sheets.Count)> Workbooks(fName).Close savechanges:=False> fName = Dir> Loop>> End Sub>>> I'll really appreciate any help with problem!> thanks>
|