Mac and Excel for Mac 16 Error

pantakos

Board Regular
Joined
Oct 10, 2012
Messages
158
Office Version
  1. 365
Platform
  1. Windows
  2. MacOS
Hello,

First I am not fluid with VBA.
With help from the forum (and thanks @DanteAmor and @Joe4) I have managed to create a code that running smoothly on Windows.
But, one of my client uses Mac ...
I know that VBA runs on Mac , but this one no.
Here are version number both Excel and MacOS


Moderator Edit:
Images removed as they contain personal info.

As you can see Office 365 is paid.

The error is


The VBA Code is

VBA Code:
Sub BuildInvoiceAll()
  Dim ws As Variant, arr1 As String, arr2 As String, arr3 As String, arr4 As String, arry As Variant
  Dim i As Long, j As Long, nr As Long
  Dim cell As Range, f As Range
  Dim Descript As String
   
  Application.ScreenUpdating = False
  'Set array of worksheet names to copy from
  ws = Array("AUDIO", "LIGHTS", "HOISTS - TRUSS - DRAPES", "DISTRO - CABLES - MISC")
 
  'cells to AUDIO sheet
  arr1 = "E13:E43, J13:J30, J32:J43, E57:E84, J57:J84, E100:E131, J100:J107," & _
        "J109:J118, J120:J131, E146:E176, E178:E191, J146:J176, J178:J184, J186:J197"
  'cells to LIGHTS sheet
  arr2 = "E13:E34, J13:J59, E36:E59, E73:E89, J73:J82, J84:J91, E91:E98, J93:J101, E100:E109, J103:J113"
  'cells to HOISTS sheet
  arr3 = "E13:E28, K13:K37, E30:E40, E42:E52, E67:E91, K67:K85, E106:E123, K106:K119, K121:K129, E127:E137"
  'cells to DISTRO sheet
  arr4 = "E13:E35, K13:K50, E37:E50, E64:E116, K64:K88, K92:K108, K111:K120, E131:E148, K131:K148, K150:K159," & _
         "E152:E180 , K163:K188 , K190:K203 , E184:E216 , K207:K238 , K240:K249 "
  arry = Array(arr1, arr2, arr3, arr4)
  nr = 14
  Sheets("PROFORMA DRYHIRE").Range("A15:C70").ClearContents
  For i = LBound(ws) To UBound(ws)                  'Loop through all shees in the array
    For Each cell In Sheets(ws(i)).Range(arry(i))   'Loop through all cells in the multirange
      If cell > 0 Then                              'See if anything entered in pieces
        Descript = cell.Offset(0, -3)               'get description from column B
        With Sheets("PROFORMA DRYHIRE")
          Set f = .Range("A15:A70").Find(Descript, , xlValues, xlWhole)
          If Not f Is Nothing Then
            nr = f.Row
          Else
            nr = nr + 1
            If nr > 70 Then
              MsgBox "Rows are full"
              Exit Sub
            End If
          End If
          .Cells(nr, "A") = Descript                'Populate values in PROFORMA sheet
          .Cells(nr, "B") = cell                    'get pieces from column E
          .Cells(nr, "C") = cell.Offset(0, -1)      'get price p/d from column D
        End With
      End If
    Next cell
  Next i
  Application.ScreenUpdating = False
End Sub
 

Sub ClearContentsAUDIO()
'   Clear All contents from Sheet - AUDIO
    Worksheets("AUDIO").Range("E13:E43, J13:J30, J32:J43, E57:E84, J57:J84, E100:E131, J100:J107, J109:J118, J120:J131, E146:E176, E178:E191, J146:J176, J178:J184, J186:J197").ClearContents
    MsgBox "Ç öüñìá AUDIO êáèÜñéóå!"
End Sub

Sub ClearContentsLIGHTS()
'   Clear All contents from Sheet - LIGHTS
    Worksheets("LIGHTS").Range("E13:E34, J13:J59, E36:E59, E73:E89, J73:J82, J84:J91, E91:E98, J93:J101, E100:E109, J103:J113").ClearContents
    MsgBox "Ç öüñìá LIGHTS êáèÜñéóå!"
End Sub

Sub ClearContentsHOIST()
'   Clear All contents from Sheet - HTD
    Worksheets("HOISTS - TRUSS - DRAPES").Range("E13:E28, K13:K37, E30:E40, E42:E52, E67:E91, K67:K85, E106:E123, K106:K119, K121:K129, E127:E137").ClearContents
    MsgBox "Ç öüñìá HTD êáèÜñéóå!"
End Sub

Sub ClearContentsDISTRO()
'   Clear All contents from Sheet - DCM
    Worksheets("DISTRO - CABLES - MISC").Range("E13:E35, K13:K50, E37:E50, E64:E116, K64:K88, K92:K108, K111:K120, E131:E148, K131:K148, K150:K159, E152:E180 , K163:K188 , K190:K203 , E184:E216 , K207:K238 , K240:K249 ").ClearContents
    MsgBox "Ç öüñìá DCM êáèÜñéóå!"
End Sub

What is it wrong? There are no redirects or mysterious coding.
Can someone give me a hint of what to change?

Thank you in advance!
 
Last edited by a moderator:

Excel Facts

Move date out one month or year
Use =EDATE(A2,1) for one month later. Use EDATE(A2,12) for one year later.
Hi,​
just check the codeline where the error occurs …​
 
Upvote 0
The problem is that I dont have access to Mac so to find out where the script get stuck ...
 
Upvote 0
As this information must be in the initial post so without it that is just a guessing challenge …​
 
Upvote 0
As this information must be in the initial post so without it that is just a guessing challenge …​
I really understand what you mean. But I dont have access, they just send me screenshots of the error. I know that this error is when opens the excel, not running something (macro etc). So I think that must be something with excel as it is. Maybe needs update
 
Upvote 0
I dont want someone to write the whole script for mac, I just need to run excel on macbook or debug to send me the error
Thank you
 
Upvote 0
Is possible someone with mac to run/compile the script to let me know, where the problem is?

Thank you
 
Upvote 0
Without any attachment here so rather than a guessing challenge the faster is obviously to query yourself the necessary information from your Mac user …​
 
Upvote 0
I can upload a test file, but I cant see an upload icon.
And yes you are correct, I have asked my mac user, but as any other users, he doesnt know how to do that. You see I am trying to do it remotely...
 
Upvote 0

Forum statistics

Threads
1,213,504
Messages
6,114,020
Members
448,543
Latest member
MartinLarkin

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top