Using Array w/ R1C1 style?

AlaskanVBA

New Member
Joined
Mar 27, 2011
Messages
6
I'm having a hard time defining an array when using R1C1 style.

For example I want to write the following code and I'm getting an error 'obect required'. This is being written after writing a "For i = #" statement. Tried using the resize function below.

F = Application.WorksheetFunction.CountIf(R4C9.Resize(FinalRow, 1), RiC1)

Any help?

Secondly, if anyone knows of a function which will check to see if the value in Row1Column1 appears in an array from Row1Column2 to Row10Column2 (for example), I'd love to know what function this is.
Does not matter if it returns TRUE/FALSE or a number. Just need a function that 'checks if it shows up elsewhere in a separate array'.

THank you!
 

Excel Facts

Does the VLOOKUP table have to be sorted?
No! when you are using an exact match, the VLOOKUP table can be in any order. Best-selling items at the top is actually the best.
Hi

Try:

Code:
F = Application.WorksheetFunction.CountIf(Cells(4,9).Resize(FinalRow, 1), Cells(i,1).value)
For the other question, check the help on the Find() method of the Range object.
 
Upvote 0
P. S.

The name of your variable FinalRow leads me to thinking that maybe the statement is not what you want?

The first parameter of Resize() is the number of rows, not the final row.
 
Upvote 0

Forum statistics

Threads
1,224,587
Messages
6,179,740
Members
452,940
Latest member
rootytrip

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