简体   繁体   中英

Excel VBA on mac - Make Directory, Hyperlink

I'm trying to make a schedule mapper with Excel. It works great so far but only on windows. Will there be any solution for the below codes to work on Mac OS as well?

Sub MakeFolders()
   ActiveSheet.Cells(4, 2).Select
   Dim Rng As Range
   Dim maxRows, maxCols, r, c As Integer
   Set Rng = Selection
   maxRows = Rng.Rows.Count
   maxCols = Rng.Columns.Count

   For c = 1 To maxCols
      r = 1
      Do While r <= maxRows
         If Len(Dir(ActiveWorkbook.Path & "\" & Rng(r, c), vbDirectory)) = 0 Then
            MkDir (ActiveWorkbook.Path & "\" & Rng(r, c))
            On Error Resume Next
         End If
         r = r + 1
      Loop
   Next c
End Sub

Below is the hyperlink to a folder that doesn't work on Mac as well.

*B16 = 14

HYPERLINK=("..\test\"&B16,"GO")

Thanks in advance for your help.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM