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:

[TABLE="class: grid, width: 250"]
<tbody>[TR]
[TD]Unique ID[/TD]
[TD]Julian Day of Run[/TD]
[/TR]
[TR]
[TD]141-1-AD1[/TD]
[TD]141[/TD]
[/TR]
[TR]
[TD]137-1-AD1[/TD]
[TD]137[/TD]
[/TR]
[TR]
[TD]137-2-AD1[/TD]
[TD]137[/TD]
[/TR]
[TR]
[TD]137-3-AD1[/TD]
[TD]137[/TD]
[/TR]
[TR]
[TD]136-1-AD1[/TD]
[TD]136[/TD]
[/TR]
[TR]
[TD]136-2-AD1[/TD]
[TD]136[/TD]
[/TR]
[TR]
[TD]135-1-AD1[/TD]
[TD]135[/TD]
[/TR]
</tbody>[/TABLE]

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

Does the VLOOKUP table have to be sorted?
No! when you are using an exact match, the VLOOKUP table can be in any order. Best-selling items at the top is actually the best.
Change
Code:
LookIn:=xlFormulas
to
Code:
LookIn:=xlValues
 
Upvote 0
Glad to help & thanks for the feedback
 
Upvote 0

Forum statistics

Threads
1,224,817
Messages
6,181,149
Members
453,021
Latest member
Justyna P

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