View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Die_Another_Day Die_Another_Day is offline
external usenet poster
 
Posts: 644
Default Find cells containing "Total"

Dim tCell as Range 'Cell Containing Total
Dim ftCell as Range 'Cell Containg First Total
Set ftCell = Cells.Find(What:="Total", After:=Range("A1"),
LookIn:=xlFormulas, _
LookAt:=xlPart, SearchOrder:=xlByRows, _
SearchDirection:=xlNext, MatchCase:=True)
if ftCell is Nothing Then End Sub
Set tCell = ftCell
Do
'Your Code
Set tCell = Cells.Find(What:="Total", After:=tCell,
LookIn:=xlFormulas, _
LookAt:=xlPart, SearchOrder:=xlByRows, _
SearchDirection:=xlNext, MatchCase:=True)
Loop Until tCell.Address = ftCell.Address

HTH

Die_Another_Day
cottage6 wrote:
Hello all,
How can I find all cells with the word "Total" included in the cell? For
example, one of the cells is "6/3/2006 Total", with "Total" always being the
last 5 characters. I've tried several things but nothing's worked. Can
anyone help? TIA