Home |
Search |
Today's Posts |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Here is my code Barb,
I'm using Office 2004 for Mac, the directory to open file is slightly different from Office for Window. ' Transfer Macro ' ' Keyboard Shortcut: Option+Cmd+x ' Mymonth = InputBox("Enter Name of Month (ALL CAPS): ") Set NewSht = ThisWorkbook.ActiveSheet Folder = "Users:Neon:Desktop:TEST FOLDER:" FName = Dir(Folder, MacID("XLS8")) 'MsgBox ("Found file:" & FName) Newrowcount = 2 Do While FName < "" Set OldBk = Workbooks.Open(Filename:=Folder & FName) For Each Sht In OldBk.Sheets 'MsgBox ("check Sheet : " & Sht.Name) With Sht Oldrowcount = 7 Do While .Range("B" & Oldrowcount) < "" If UCase(.Range("B" & Oldrowcount)) = Mymonth Then 'Range("B7:B38").Copy 'Range("D1").PasteSpecial Paste:=xlPasteValues .Rows(Oldrowcount).Copy _ Destination:=NewSht.Rows(Newrowcount) 'NewSht.Range("A" & Newrowcount) = .Range("A" & Oldrowcount) 'NewSht.Range("B" & Newrowcount) = .Range("B" & Oldrowcount) 'NewSht.Range("C" & Newrowcount) = .Range("C" & Oldrowcount) 'NewSht.Range("D" & Newrowcount) = .Range("D" & Oldrowcount) Newrowcount = Newrowcount + 1 End If Oldrowcount = Oldrowcount + 1 Loop End With Next Sht OldBk.Close savechanges:=False FName = Dir() 'MsgBox ("Found file : " & FName) Loop End Sub Thank you, Neon520 "Barb Reinhardt" wrote: Please provide your code and we can assist in fixing it. Barb Reinhardt |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Open Excel file get error with file names that have spaces in the | Setting up and Configuration of Excel | |||
Error 55 File Already Open | Excel Programming | |||
EXCEL:Can't open any file without error saying it's ALREADY open??? | Excel Worksheet Functions | |||
open file file then error message | Excel Discussion (Misc queries) | |||
hyperlink error: "Cannot open the specified file" | Excel Worksheet Functions |