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

Highlight Duplicates
Home, Conditional Formatting, Highlight Cells, Duplicate records, OK to add pink formatting to any duplicates in selected range.
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,223,903
Messages
6,175,279
Members
452,630
Latest member
OdubiYouth

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