Vba Excel code gives me Compile Error, Expected: List Separator or ) on my Mac

cfreeman

New Member
Joined
Dec 22, 2016
Messages
5
Here is the code I used which I got from MrExcel Youtube video for the macro NextInvoice. I keep getting this error

Compile Error, Expected: List Separator or )

It highlights the colon as the problem. I'm using Excel 2011 for Mac

Sub NextInvoice()
Range(“F4”).Value = Range(“F4”).Value + 1
Range(“A21:F36”).ClearContents
End Sub
 

Excel Facts

Control Word Wrap
Press Alt+Enter to move to a new row in a cell. Lets you control where the words wrap.
You seem to have strange quote characters, “ should be ".
 
Upvote 0
If you copy and paste the code below does it work?
Code:
Sub NextInvoice()
    Range("F4").Value = Range(“F4”).Value + 1
    Range("A21:F36").ClearContents
End Sub
 
Upvote 0
I've copied and pasted and I don't get that error code anymore but now I'm getting a new one;

Sub NextInvoice() is highlighted and the error message say undifined variable
 
Upvote 0
When I assign it to the shape and click on the lightning bolt now I just get 400 Microsoft Visual Basic. Very strange
 
Upvote 0

Forum statistics

Threads
1,214,958
Messages
6,122,475
Members
449,087
Latest member
RExcelSearch

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