Recording a Macro that follows Keystrokes

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hello,
I have a column of descriptions which all end in "Total" - (I did a subtotal
and copied the results into another worksheet.).
I tried recording a Macro to delete the "Total", but for every cell below
the first it just copied what I had done in the first cell.

Is there a way I can get rid of the "Total" at the end, without having to
manually go through all 26,000 lines?

Thanks
 
Select the cells and run:

Sub nototal()
For Each r In Selection
r.Value = Replace(r.Value, "Total", "")
Next
End Sub
 
How about selecting the range
Edit|replace
what: Total
with: (leave blank)
replace all

But you may have _Total (spacebar total). You may want to get rid of " total",
not just "total".

If you need a macro, record one when you select the column and do the
edit|Replace.
 
Thanks, that worked a treat

Gary''s Student said:
Select the cells and run:

Sub nototal()
For Each r In Selection
r.Value = Replace(r.Value, "Total", "")
Next
End Sub
 
Back
Top