ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Find and Replace several items (https://www.excelbanter.com/excel-programming/344294-find-replace-several-items.html)

rachelreveley

Find and Replace several items
 

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


Don Guillett[_4_]

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





All times are GMT +1. The time now is 07:25 AM.

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