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

Move date out one month or year
Use =EDATE(A2,1) for one month later. Use EDATE(A2,12) for one year later.
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,224,823
Messages
6,181,181
Members
453,022
Latest member
Mohamed Magdi Tawfiq Emam

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