Wildcard in Excel for Mac to open ALL files
Do a search in VBA help for "DIR Function" and then also look at MACID.
I modified the last code that I posted as follows
1) Added the Colons into the Folder name instead of the slashes I originally
had.
2) Didn't added the : to the end of Folder. Dir() on Mac wants a folder
name not a fileName.
3) On the workbook.Open added the : to the filename which includes the
folder name.
4) Modified the Dir() statement to use MacId("XLS8"). Not sure if XLS8 is
correct since the HELP says it is for Excel 97. Youare probably using Excel
11 and I'm not sure if XLS8 is correct.
Sub Transfer()
'
' Transfer Macro
'
' Keyboard Shortcut: Option+Cmd+x
'
Set NewSht = ThisWorkbook.ActiveSheet
Folder = ":Users:Neon:Desktop:TEST FOLDER"
FName = Dir(Folder, MacID("XLS8"))
MsgBox ("Found file : " & FName)
NewRowCount = 1
Do While FName < ""
Set OldBk = Workbooks.Open(Filename:=Folder & ":" & FName)
For Each Sht In OldBk.Sheets
MsgBox ("check Sheet : " & Sht.Name)
With Sht
OldRowCount = 1
Do While .Range("B" & OldRowCount) < ""
If UCase(.Range("B" & OldRowCount)) = "DECEMBER" Then
.Rows(OldRowCount).Copy _
Destination:=NewSht.Rows(NewRowCount)
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
"Neon520" wrote:
Hi Everyone,
Does anyone know what the WILDCARD is to open ALL files in Excel for Mac?
As I get to know this from Joel, one of the great contributors to the forum,
the wildcard for PC Excel is *.xls.
But I don't know what the wildcard is for the Excel for Mac.
I'm trying to open ALL Excel files in a folder to extract some data in them,
but I need to know the wildcard to open all of them.
HELP!!!
Neon520
|