View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.misc
Luke M Luke M is offline
external usenet poster
 
Posts: 2,722
Default remove all characters before a certain one

This is setup to run on whatever cells you have selected upon activation

Sub SpecialFind()

'Note you could change Selection to
'something like Range("A2:A10")
For Each Cell In Selection
If Cell.Value Like "*&*" Then
Cell.Replace What:="*&", Replacement:=""
Else
Cell.Value = ""
End If
Next
End Sub
--
Best Regards,

Luke M
*Remember to click "yes" if this post helped you!*


"Imajica12345" wrote:

is there a way to program a macro to remove all characters before "&" in a
cell, or range of cells? At the same time, if a cell does not contain a "&"
to delete the contents.

Ex.

Mike & Jill would become Jill
Mike would be come ""