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.
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.