Help to correct Syntax ... Error: Wrong number of Arguements or Invalid property Arguement

NimishK

Well-known Member
Joined
Sep 4, 2015
Messages
688
Hi
Can someone help me to correct my syntax below

As i am getting error Wrong number of Arguements or Invalid property Arguement

Code:
Dim a as Variant
Dim matchValueString as String
Dim curRow as Long
Dim lstRow as Long

a = Application.Match(matchValueString, (xWk.Range(Cells(3, curRow), Cells(3, lstRow), 0)))
or
a = Application.Match(matchValueString, (xWk.Cells(3, curRow)), Cells(3, lstRow), 0)
Thanks
NimishK
 
Last edited:

Excel Facts

Whats the difference between CONCAT and CONCATENATE?
The newer CONCAT function can reference a range of cells. =CONCATENATE(A1,A2,A3,A4,A5) becomes =CONCAT(A1:A5)
I think maybe this is what you are looking for...
Code:
[table="width: 500"]
[tr]
	[td]a = Application.Match(matchValueString, xWk.Range(xWk.Cells(3, curRow), xWk.Cells(3, lstRow)), 0)[/td]
[/tr]
[/table]
 
Upvote 0
Try:
Code:
a = Application.Match(matchValueString, xWk.Range(xWk.Cells(3, curRow), xWk.Cells(3, lstRow)), 0)
 
Upvote 0
I wish posts prior to mine would appear sooner so I would know not to waste my dwindling energy!!!!!!!!!!! :mad:

Dwindling energy? C'mon, I don't take you to be an old man like I am. :wink:
 
Last edited:
Upvote 0
Code:
...xWk.Range(xWk.Cells(3, curRow), xWk.Cells(3, lstRow)...

That's either wrong or a misleading choice of variable names; curRow and lstRow both refer to columns.
 
Upvote 0
Vow What a coincedence of perfection of Same syntax from Two MrExcel MVPs.
Thanks a ton ! :):beerchug: Rick and JoeMo

NimishK
 
Upvote 0
Shg
That's either wrong or a misleading choice of variable names; curRow and lstRow both refer to columns.
Yes you are Absolutely right thanks for the correction. Have interchanged
xWk.Range(xWk.Cells(curRow,3), xWk.Cells(lstRow, 2)...

Thanks Nimishk
 
Last edited:
Upvote 0

Forum statistics

Threads
1,223,231
Messages
6,170,884
Members
452,364
Latest member
springate

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