View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Don Guillett[_4_] Don Guillett[_4_] is offline
external usenet poster
 
Posts: 2,337
Default Find and Replace several items

the macro recorder is your friend
Sub Macro6()
'
' Macro6 Macro
' Macro recorded 10/31/2005 by Don Guillett
'

'
Columns("H:H").Select
Selection.Replace What:="books", Replacement:="1", LookAt:=xlPart, _
SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False
End Sub

cleaned up to this
Sub replaceallincolumn()
With Columns("H")
..Replace what:="books", replacement:=1
..Replace what:="papers", replacement:=2
End With
End Sub
--
Don Guillett
SalesAid Software

"rachelreveley"
wrote in message
news:rachelreveley.1xs62c_1130785513.6659@excelfor um-nospam.com...

H,

I need a macro that will allow me to do several find and replace
actions within a specific column. The column will have category
infromation selected by our customers from a drop down list such as
automotive, books etc. We need to then convert these to numbers so
automotive becomes 1, books becomes 2 etc.

Any ideas?


--
rachelreveley
------------------------------------------------------------------------
rachelreveley's Profile:

http://www.excelforum.com/member.php...fo&userid=2138
View this thread: http://www.excelforum.com/showthread...hreadid=480663