Replace text with numbers.
Columns("A:A").Select
Selection.Replace What:="advertising", Replacement:="61300",
LookAt:=xlWhole, _
SearchOrder:=xlByRows, MatchCase:=False
Selection.Replace What:="Purchases", Replacement:="51000",
LookAt:=xlWhole, _
SearchOrder:=xlByRows, MatchCase:=False
or
Sub MakeReplacements()
dim varr as variant, varr1 as variant, i as long
varr = Array("advertising", "purchases")
varr1 = Array(63100, 51000)
for i = lbound(varr) to ubound(varr)
Columns(A:A).Replace What:=varr(i), Replacement:=varr1(i), _
LookAt:=xlWhole, SearchOrder:=xlByRows, MatchCase:=False
Next i
End Sub
--
Regards,
Tom Ogilvy
"Josh" wrote in message
om...
I'm working with importing text files into Excel that have account
names listed in one column and I'd like to repalce the account name
with an account number. For Example, I would like to replace the name
ADVERTISING with the number 63100 and I would like to replace the name
PURCHASES with the number 51000. I would like to know if someone
would be able to get me started with an Excel macro that I would just
be able to continue the same formatting, adding records to achieve the
same results but within a shorter period of time. Does anybody have
an idea of how to help me get this one started?
Thanks for helping,
Josh
|