Find cell containing £

coop123

Board Regular
Joined
Dec 18, 2018
Messages
66
Office Version
  1. 365
Hi

I am using the following code to find cells formatted as currency £.
1671701898785.png

Cells.Find(What:="£", After:=ActiveCell, LookIn:=xlValues, LookAt:= _
xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext, MatchCase:=False _
, SearchFormat:=False).Activate
This is giving me the following error message, Run-time error '91': object variable or With block variable not set.

Can someone please give me some help to fix the problem.

Thanks

coop123
 

Attachments

  • 1671701353251.png
    1671701353251.png
    1.9 KB · Views: 6
I changed it back as you suggested but still no success.

I have found another peice of code that does what I need.
Dim rng As Range, r As Range, rFound As Range

Set rFound = Nothing
For Each r In ActiveSheet.UsedRange
If InStr(1, r.Text, "£") > 0 Then
If rFound Is Nothing Then
Set rFound = r
Else
Set rFound = Union(rFound, r)
End If
End If
Next r

If Not rFound Is Nothing Then rFound.Select
Thank you for your time trying to fix my problem.

coop123
 
Upvote 0

Excel Facts

Format cells as currency
Select range and press Ctrl+Shift+4 to format cells as currency. (Shift 4 is the $ sign).

Forum statistics

Threads
1,215,054
Messages
6,122,901
Members
449,097
Latest member
dbomb1414

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