Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Find cell contents within a data matrix
I am trying to write a macro that will find and select the first
instance of a value that the user had previously inputted into a cell (let's say it's on sheet 1 in cell A1) within column C of a large data matrix, where the matrix has been named DATA. How can I do this? Many thanks. |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Find cell contents within a data matrix
Dim r as Range, r1 as Range, r2 as Range
Dim res as Variant set r = worksheets("Data").Columns(3).Cells set r1 = Worksheets("Sheet1").Range("A1") res = Application.match(r,r1,0) if not iserror(res) then set r2 = r1(res) msgbox "found at " & r2.Address(0,0,xlA1,True) else msgbox "Not found" End if -- Regards, Tom Ogilvy " wrote: I am trying to write a macro that will find and select the first instance of a value that the user had previously inputted into a cell (let's say it's on sheet 1 in cell A1) within column C of a large data matrix, where the matrix has been named DATA. How can I do this? Many thanks. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Find contents of the last cell in a row | Excel Worksheet Functions | |||
Find Contents of Cell (Macro) - Help me! | Excel Programming | |||
Find Cell Contents on Another Sheet in Workbook | Excel Programming | |||
Find cell contents in range | Excel Discussion (Misc queries) | |||
How do I find the contents of a cell using the "ADDRESS" function. | Excel Worksheet Functions |