+ Reply to Thread
Results 1 to 2 of 2

Find and Replace several items

  1. #1
    Registered User
    Join Date
    10-30-2003
    Location
    London
    Posts
    1

    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?

  2. #2
    Don Guillett
    Guest

    Re: 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
    [email protected]
    "rachelreveley" <[email protected]>
    wrote in message
    news:[email protected]...
    >
    > 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
    >




+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1