Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 28
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6,953
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Find contents of the last cell in a row OCONUS Excel Worksheet Functions 4 September 18th 06 09:37 PM
Find Contents of Cell (Macro) - Help me! MrMerton[_6_] Excel Programming 7 October 27th 05 03:55 PM
Find Cell Contents on Another Sheet in Workbook Jana[_3_] Excel Programming 5 September 22nd 05 08:38 PM
Find cell contents in range Nigel Excel Discussion (Misc queries) 7 May 16th 05 01:15 PM
How do I find the contents of a cell using the "ADDRESS" function. sweeney Excel Worksheet Functions 2 April 5th 05 03:23 AM


All times are GMT +1. The time now is 07:05 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"