Home |
Search |
Today's Posts |
#6
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() try to use smtg like that... the code is not optimized i suppose - I didnt check it coz it's late :-) Sub ff() Dim fs As Object Dim temp_name, folder_name, base_file, temp_file As String Dim i, j As Long temp_name = ".xls" folder_name = "C:\" base_file = Application.ActiveWorkbook.Name Set fs = Application.FileSearch With fs ..NewSearch ..LookIn = folder_name ..SearchSubFolders = False ..MatchTextExactly = False ..Filename = temp_name ..Execute If .FoundFiles.Count 0 Then For i = 1 To .FoundFiles.Count Workbooks.Open Filename:=.FoundFiles(i) temp_file = Application.ActiveWorkbook.Name Sheets(1).Copy After:=Workbooks(base_file).Sheets(Application.Wor kbooks(base_file).Sheets.C ount) Workbooks(temp_file).Close SaveChanges:=False Next i For j = 1 To Workbooks(base_file).Sheets.Count Sheets(j).Select ActiveWindow.SelectedSheets.PrintOut Copies:=1 Next j Else MsgBox "No files to perform!" End If End With End Sub |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
set filename to <filename-date on open | Excel Worksheet Functions | |||
filename search and extract into a cell | Excel Discussion (Misc queries) | |||
Search filename containing words | Excel Programming | |||
Saving filename same as import filename | Excel Programming | |||
Filename search using Office 97 with Windows 2000 | Excel Programming |