Find and Replace - delete the remainder of the text in the cell after my Find

  • Thread starter Thread starter ArgarLargar
  • Start date Start date
A

ArgarLargar

I want to Find characters "temporary=*" in cells with * being a
wildcard. The text after "temporary=" could vary per cell.

Then I want to Select that text and delete it from the cell. I still
want the characters that appear before "temporary=*."

Any suggestions?

Thanks,

Nick
 
I want to Find characters "temporary=*" in cells with * being a
wildcard. The text after "temporary=" could vary per cell.

Then I want to Select that text and delete it from the cell. I still
want the characters that appear before "temporary=*."

Any suggestions?

Thanks,

Nick


=LEFT(A1,FIND("temporary=",A1)-1)


--ron
 
I want to Find characters "temporary=*" in cells with * being a
wildcard. The text after "temporary=" could vary per cell.

Then I want to Select that text and delete it from the cell. I still
want the characters that appear before "temporary=*."

Any suggestions?

Thanks,

Nick

If you want to do this in VBA, and delete the text in the same cell, then this
macro will get you started:

=======================================
Sub DelTemp()
Dim c As Range
For Each c In Selection
c.Value = Left(c.Text, InStr(1, c.Text, "temporary=") - 1)
Next c
End Sub
============================
--ron
 
You may not need a VBA solution....as long as you don't have an
extraordinarily large number of cells to change AND those cells only contain
ONE equal sign (=)

Try this:

Select your range of cells to be impacted

[Ctrl]+F..........a shortcut for <edit><find>
Find what: *temporary=*
Click [Find All]

(that will select the first matching cell)

[Ctrl]+A........that will select the rest of the matching cells

Click the Replace tab
Find what: =*
Replace with: =
Click [Replace All]

(that will clear all text after the equal sign in the matched cells)

Does that help?
***********
Regards,
Ron

XL2003, WinXP
 
Back
Top