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

Can a formula spear through sheets?
Use =SUM(January:December!E7) to sum E7 on all of the sheets from January through December
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,424
Messages
6,119,400
Members
448,893
Latest member
AtariBaby

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