Expected: List Separator or ) Error: SYNTAX

SBF12345

Well-known Member
Joined
Jul 26, 2014
Messages
614
Greetings,

I am receiving an "expected: list separator or )" on the following line.

Code:
C = PA.ws.Range(Cells(D, "A"): Cells(G, "A")).Rows.Count

I am trying to set an integer variable for a range of cells defined by other integer variables. Where is the error?
 

Excel Facts

Workdays for a market open Mon, Wed, Friday?
Yes! Use "0101011" for the weekend argument in NETWORKDAYS.INTL or WORKDAY.INTL. The 7 digits start on Monday. 1 means it is a weekend.
I had to change it to this in order to get it to work without errors for me:
Code:
[COLOR=#333333]C = PA.ws.Range(Cells(D, "A"), Cells(G, "A")).Rows.Count[/COLOR]
 
Upvote 0
Couldn't you just calculate the difference between D and G?

By the way, I can see various other potential problems with the code.

For example, what does PA.ws refer to?

If PA is a workbook reference then it won't have a property ws, even if ws is a reference to a worksheet in the workbook PA.
 
Upvote 0

Forum statistics

Threads
1,226,112
Messages
6,189,041
Members
453,521
Latest member
Chris_Hed

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