Re: Find and Replace several items

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

Selection.Replace What:="books", Replacement:="1", LookAt:=xlPart, _
SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=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" <rachelreveley.1xs62c_1130785513.6659@xxxxxxxxxxxxxxxxxxxxx>
wrote in message
> 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:
> View this thread:


Relevant Pages

  • Re: start programing
    ... This should open the Visual Basic Editor. ... Visual Basic automatically will create an "End Sub". ... program to set the font attributes, borders and color of the cell. ... Macro Recorder, select the cell, set Bold, heavy border outline ...
  • Re: VBScipt: Can you help me automate this ?
    ... End Sub ... as the macro recorder makes Selects before carrying out the processing, and records your movements around the screen whilst recording. ... It then divides this figure by 13, and takes the Integer of this value and adds 2, to ensure we have a count for the outer loop which is 1 greater than the number of "blocks" of data to process. ... When the inner loop is completed, tbl is resized to be the range of blank cells below row "i" down to the next block of data, and these rows are deleted. ...
  • Re: VBScipt: Can you help me automate this ?
    ... "Roger Govier" wrote: ... End Sub ... as the macro recorder makes Selects before carrying out the processing, ... This calculated value is used as the upper limit for the "i" loop which ...
  • Re: Creating graphs in VBA
    ... Did you try the macro recorder? ... Sub Macro1() ... ' Macro1 Macro ... Set a = Worksheets("Regional Issue Graphs") ...
  • Re: locate cell with specific text and select that column
    ... The macro recorder can be your friend. ... Sub Macro2() ... ' Macro2 Macro ... ' Macro recorded 7/30/2008 by Donald B. Guillett ...