Find displayed value of cell

kod2th3e

Board Regular
Joined
Apr 2, 2008
Messages
87
I am using the following method to find the uniqueID supplied by a user on a sheet:

Code:
Cells.Find(What:=uniqueID, After:=ActiveCell, LookIn:=xlFormulas, _
        LookAt:=xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext, _
        MatchCase:=False, SearchFormat:=True).Activate

When I use this, I get an error because the value can't be found even though it exists on the sheet. I believe the reason is because the value on the sheet is the result of a formula (that concatenates a couple of cells together) rather than a string of text.


Here is a snapshot of the table that I'm looking at:

Unique IDJulian Day of Run
141-1-AD1141
137-1-AD1137
137-2-AD1137
137-3-AD1137
136-1-AD1136
136-2-AD1136
135-1-AD1135

<tbody>
</tbody>

The formula used in colA (Unique ID) to generate the ID is as follows:

=IF(B2="","",B2 & "-" & COUNTIF(B$2:B2,B2) & "-AD1")

Is there any way to search for and find the displayed cell value rather than a string within the formula or text within the cell?
 

Excel Facts

Can you sort left to right?
To sort left-to-right, use the Sort dialog box. Click Options. Choose "Sort left to right"
Change
Code:
LookIn:=xlFormulas
to
Code:
LookIn:=xlValues
 
Upvote 0
Glad to help & thanks for the feedback
 
Upvote 0

Forum statistics

Threads
1,214,839
Messages
6,121,887
Members
449,057
Latest member
Moo4247

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