ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Find and Replace - delete the remainder of the text in the cell after my Find (https://www.excelbanter.com/excel-programming/394780-find-replace-delete-remainder-text-cell-after-my-find.html)

[email protected]

Find and Replace - delete the remainder of the text in the cell after my Find
 
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


Ron Rosenfeld

Find and Replace - delete the remainder of the text in the cell after my Find
 
On Fri, 03 Aug 2007 14:45:46 -0700, wrote:

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

Ron Rosenfeld

Find and Replace - delete the remainder of the text in the cell after my Find
 
On Fri, 03 Aug 2007 14:45:46 -0700, wrote:

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

Ron Coderre

Find and Replace - delete the remainder of the text in the cell af
 
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


" wrote:

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



[email protected]

Find and Replace - delete the remainder of the text in the cell af
 
Ron,

I appreciate the assistance. I going to try this later tonight.

Nick



All times are GMT +1. The time now is 08:33 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com