Avatar of slatefamily
slatefamily
 asked on

Find/Replace text in Excel 2001

Should be easy, but i'm in a crunch and need help fast.

I have a column:

PROC5 Provider




Q-67047



Q-39884

Q-22709
Q-97099

Q-60021


I want to keep all the blank rows blank, and change any field that has data (all starting wtih Q) to the text "Midas"

Help please :)

Thanks in advance.
Microsoft Excel

Avatar of undefined
Last Comment
slatefamily

8/22/2022 - Mon
netballi

Hello,

try the following formula in column B1, assuming the data is in column A

=IF(ISBLANK(A1),"",CONCATENATE("Q-",A1))
wshark83

try CTRL H- and find Q- and replace with text but this will keep the numbers

alternatively here's a macro which will do that (you will need to change the range("A1:A15"):

Sub Workbook_BeforePrint()
    Dim r As Range
    Set r = ThisWorkbook.Sheets(1).Range("A1:A15")
    For Each cell In r
        If IsEmpty(cell) Then
        ElseIf LCase(Mid(cell.Value, 1, 1)) = "q" Then cell.Value = "Midas"
          Exit For
        End If
    Next
End Sub
slatefamily

ASKER
well I was able to use this formula to do what I needed it to:

=SUBSTITUTE(FA14, FA14, "Midas")
Your help has saved me hundreds of hours of internet surfing.
fblack61
slatefamily

ASKER
I wanted to take out the whole cell that contained any text and replace it with a generic term.  The substitution formula I found online is what helped me, I am not sure this was the correct way to do it but I achieved what I needed.  If anyone else can post a way to do it without using another column field, I would still be interested.
ASKER CERTIFIED SOLUTION
lee555J5

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
slatefamily

ASKER
I was hoping to use something like that but I got an error

Doc1.doc
slatefamily

ASKER
I couldn't get the macro to work.
⚡ FREE TRIAL OFFER
Try out a week of full access for free.
Find out why thousands trust the EE community with their toughest problems.
lee555J5

Are you using Excel 2010, and your question title "Excel 2001" is a typo?

I just tested this on 2 boxes running Win7 SP1 64bit and Office 2010 SP1 32bit. If a single cell is selected, it does the whole sheet. If more than 1 cell is selected, it works only on the selected range. Mine seems to be doing exactly what you need yours to do, I don't know why yours isn't working.

Are your cells containing "Q-*" just data cells, or is the "Q-*" the result of a formula?
Rory Archibald

Your data are actually formulas. Use:

Find: ="Q-*"
Replace: Midas
slatefamily

ASKER
Does not work.  Microsoft Excel cannot find any data to replace.  Check to see if your data and formatting are correct.
All of life is about relationships, and EE has made a viirtual community a real community. It lifts everyone's boat
William Peck
slatefamily

ASKER
TYPO, it is 2007
slatefamily

ASKER
lee555J5,

The cells contaning Q- are just text.
slatefamily

ASKER
I got it to work!
⚡ FREE TRIAL OFFER
Try out a week of full access for free.
Find out why thousands trust the EE community with their toughest problems.
lee555J5

What made it work? What fixed it?
wshark83

i tested the macro and that worked so strange why it didn't work on yours....well done atleast its solved
slatefamily

ASKER
I think why it originally didn't work for either (macro included), was because the file was protected.
Experts Exchange is like having an extremely knowledgeable team sitting and waiting for your call. Couldn't do my job half as well as I do without it!
James Murphy