I am using the following method to find the uniqueID supplied by a user on a sheet:
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?
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?