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

NimishK

Well-known Member
Joined
Sep 4, 2015
Messages
653
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

How to total the visible cells?
From the first blank cell below a filtered data set, press Alt+=. Instead of SUM, you will get SUBTOTAL(9,)

Rick Rothstein

MrExcel MVP
Joined
Apr 18, 2011
Messages
38,020
Office Version
  1. 2019
  2. 2010
Platform
  1. Windows
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]
 

JoeMo

MrExcel MVP
Joined
May 26, 2009
Messages
17,939
Office Version
  1. 365
  2. 2010
Platform
  1. Windows
Try:
Code:
a = Application.Match(matchValueString, xWk.Range(xWk.Cells(3, curRow), xWk.Cells(3, lstRow)), 0)
 

Rick Rothstein

MrExcel MVP
Joined
Apr 18, 2011
Messages
38,020
Office Version
  1. 2019
  2. 2010
Platform
  1. Windows
Try:
Code:
a = Application.Match(matchValueString, xWk.Range(xWk.Cells(3, curRow), xWk.Cells(3, lstRow)), 0)

I wish I had thought of that formula. :devilish:
 
Last edited:

JoeMo

MrExcel MVP
Joined
May 26, 2009
Messages
17,939
Office Version
  1. 365
  2. 2010
Platform
  1. Windows
I wish I had thought of that formula. :devilish:
I wish posts prior to mine would appear sooner so I would know not to waste my dwindling energy!!!!!!!!!!! :mad:
 

Rick Rothstein

MrExcel MVP
Joined
Apr 18, 2011
Messages
38,020
Office Version
  1. 2019
  2. 2010
Platform
  1. Windows
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:

shg

MrExcel MVP
Joined
May 7, 2008
Messages
21,836
Office Version
  1. 2010
Platform
  1. Windows
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.
 

NimishK

Well-known Member
Joined
Sep 4, 2015
Messages
653
Vow What a coincedence of perfection of Same syntax from Two MrExcel MVPs.
Thanks a ton ! :)(y) Rick and JoeMo

NimishK
 

NimishK

Well-known Member
Joined
Sep 4, 2015
Messages
653
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:

Forum statistics

Threads
1,171,533
Messages
5,876,044
Members
433,170
Latest member
Gott

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