AndrewDrewAndy
New Member
- Joined
- Nov 18, 2019
- Messages
- 16
I am running this code and it works well on desktop, but I am not able to run this on Mac. Is there a way to make the path work for both desktop and mac? See code below.
Thank You!
Sub AndrewDrew()
Dim Ary As Variant
Dim i As Long
Dim Pth As String
Pth = Sheets("Master Data").Range("A1")
If Not Right(Pth, 1) = "\" Then Pth = Pth & "\"
Ary = Array("Export 1", "Export 2", "Export 4")
For i = 0 To UBound(Ary)
Sheets(Ary(i)).Copy
With ActiveWorkbook
.SaveAs Pth & Range("C5").Value, 51
.Close False
End With
Next i
End Sub
Thank You!
Sub AndrewDrew()
Dim Ary As Variant
Dim i As Long
Dim Pth As String
Pth = Sheets("Master Data").Range("A1")
If Not Right(Pth, 1) = "\" Then Pth = Pth & "\"
Ary = Array("Export 1", "Export 2", "Export 4")
For i = 0 To UBound(Ary)
Sheets(Ary(i)).Copy
With ActiveWorkbook
.SaveAs Pth & Range("C5").Value, 51
.Close False
End With
Next i
End Sub