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

What is the last column in Excel?
Excel columns run from A to Z, AA to AZ, AAA to XFD. The last column is XFD.

Norie

Well-known Member
Joined
Apr 28, 2004
Messages
76,358
Office Version
  1. 365
Platform
  1. Windows
You seem to have strange quote characters, “ should be ".
 
Upvote 0

Norie

Well-known Member
Joined
Apr 28, 2004
Messages
76,358
Office Version
  1. 365
Platform
  1. Windows
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

cfreeman

New Member
Joined
Dec 22, 2016
Messages
5
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

cfreeman

New Member
Joined
Dec 22, 2016
Messages
5
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,191,076
Messages
5,984,495
Members
439,893
Latest member
johnsboxftm

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
Top