View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
Mifty Mifty is offline
external usenet poster
 
Posts: 99
Default Macro to remove word from text in a cell

Thank you Matthew,

Just the job
Cheers
--
Mifty


"Matthew Pfluger" wrote:

Hi, Mifty. Use this:

sub removeProv()
For each r in selection
r.value = replace(r.value," Provisional","")
next
End Sub

HTH,
Matthew Pfluger

"Mifty" wrote:

Hi Everyone,

I posted recently to ask how to add a word to a line of text in a cell using
a recorded macro that would run on a number of workbooks where the text was
slightly different but needed "provisional adding at the end.

Gary's Student kindly provided this

Select the cells and run:

Sub prov()
For Each r In Selection
r.Value = r.Value & " Provisional"
Next
End Sub

Works brilliantly !!!

BUT now I need to remove the "Provisional" from the end of the line of text.
Wouldn't you know it :-)

Any ideas would be brilliant
Thanks
--
Mifty