Finding the address of a matched cell with VBA

PoroBro

New Member
Joined
Jul 3, 2018
Messages
3
Hey.

I need to change the below cell code into VBA code.
=ADDRESS($O$7;MATCH(K7;'3rd exercise'!3:3;0))

Just to clarify, I am trying to remove unnecessary cells from the worksheets, so all the cell references are already variables in the code, except for the '3rd exercise'!3:3 as it is a value that has to be looked for.

I am new to VBA so if you can add anything to clarify how everything works, I'd love it. Thanks upfront!
 

Excel Facts

Square and cube roots
The =SQRT(25) is a square root. For a cube root, use =125^(1/3). For a fourth root, use =625^(1/4).
Assuming you have the value from $O$7 stored in a variable called rowNum and you have the value from K7 stored in a variable called findVal then it would be something like this:

Code:
rowNum = Range("O7").Value
findVal = Range("K7").Value
cellAddress = Cells(rowNum, Application.Match(findVal, Sheets("3rd exercise").Range("3:3"), 0)).Address

I haven't run or tested this code however.

WBD
 
Upvote 0

Forum statistics

Threads
1,223,908
Messages
6,175,307
Members
452,633
Latest member
DougMo

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