Contains Text

CBorders

New Member
Joined
Sep 23, 2011
Messages
16
I'm trying to write a macro that executes when the cell in column A contains the word Total. Looking online, I keep seeing examples that make me think Find should work, but every time I try to run it I am told that the Sub or Function is undefined.

My current code is:

Sub AddTotals()
'
' AddTotals Macro
' Add the Totals for each location
'

'

Dim Location As Currency


Range("A1").Select
Do While (IsEmpty(ActiveCell) = False Or IsEmpty(ActiveCell.Offset(1,0)) = False)
If IsNumber(Find("Total", A1)) Then
ActiveCell.Offset(0, 7).Value = Location And Location = 0
Else
Location = Location + ActiveCell.Offset(0, 7).Value
End If
ActiveCell.Offset(1, 0).Select

Loop

End Sub

Any assistance for why Find isn't working for me would be appreciated.
 

Excel Facts

Get help while writing formula
Click the italics "fx" icon to the left of the formula bar to open the Functions Arguments dialog. Help is displayed for each argument.

Forum statistics

Threads
1,224,616
Messages
6,179,908
Members
452,949
Latest member
beartooth91

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