Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Excel / Programming / September 2007

Tip: Looking for answers? Try searching our database.

Find cell contents within a data matrix

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
vrzimmerm@hotmail.com - 19 Sep 2007 15:10 GMT
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.
Tom Ogilvy - 19 Sep 2007 15:36 GMT
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

Signature

Regards,
Tom Ogilvy

> 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
[quoted text clipped - 3 lines]
>
> Many thanks.
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.