Select a row with a specific value in a given range

mkingrey

New Member
Joined
Nov 2, 2005
Messages
49
In row 1 of my worksheet I have a list of headers that contain dates. I need to write vba code that will select the cell(header) with a specific value in it.

Example,

if myVariable="11/28/2005" then I want to select the cell(header) with a value of 11/28/2005.

Logically I planned on using the MATCH worksheet function and then the ADDRESS worksheet function to return the cell address and then set the selection to the resulting address: Range(returnedaddress).Select

.....but this didn't work because the ADDRESS worksheet can't be used in VBA.

Can anyone help b/c I'm stumped?...thanks... [/list][/list]
 

Excel Facts

Why does 9 mean SUM in SUBTOTAL?
It is because Sum is the 9th alphabetically in Average, Count, CountA, Max, Min, Product, StDev.S, StDev.P, Sum, VAR.S, VAR.P.
Something like?
Code:
Range("A1").Offset(, Application.WorksheetFunction.Match _
    (myVariable, Range("A1:Z1").Value, 0) - 1).Select
 
Upvote 0

Forum statistics

Threads
1,214,990
Messages
6,122,625
Members
449,093
Latest member
catterz66

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