Results 1 to 4 of 4

Simple Replacement

This is a discussion on Simple Replacement within the Excel Questions forums, part of the Question Forums category; Hi, I have a macro and at one part of it I need it to do the following: Input Column ...

  1. #1
    Board Regular
    Join Date
    Nov 2009
    Posts
    98

    Default Simple Replacement

    Hi,

    I have a macro and at one part of it I need it to do the following:

    Input

    Column C

    word word word
    word word
    word word word word
    word word
    ...

    Output

    Column F

    word-word-word
    word-word
    word-word-word-word
    word-word
    ...

    As you see, I want to replace the spaces, " ", with "-". Thanks in advance.
    I use Excel 2007.

  2. #2
    Board Regular
    Join Date
    Jul 2006
    Location
    Brussels
    Posts
    7,647

    Default Re: Simple Replacement

    For instance:

    Code:
    Columns(3).Replace " ", ""
    Regards,


    Wigi


    Excel MVP 2011-2014



    For more Excel memes: visit http://www.wimgielis.be ==> English articles ==> Excel memes

    -- Topics without [CODE] tags or a meaningful topic title, will be neglected by me (and probably many others as well) --

  3. #3
    Board Regular
    Join Date
    Aug 2004
    Location
    Sittingbourne,Kent
    Posts
    299

    Default Re: Simple Replacement

    you probably don't actually need a macro, you could use excel's find/replace inbuilt function

    ctrl+h

  4. #4
    Board Regular
    Join Date
    Jul 2006
    Location
    Brussels
    Posts
    7,647

    Default Re: Simple Replacement

    Quote Originally Posted by cmmadn View Post
    you probably don't actually need a macro
    Quote Originally Posted by excelnow View Post
    I have a macro and at one part of it ...
    Regards,


    Wigi


    Excel MVP 2011-2014



    For more Excel memes: visit http://www.wimgielis.be ==> English articles ==> Excel memes

    -- Topics without [CODE] tags or a meaningful topic title, will be neglected by me (and probably many others as well) --

Like this thread? Share it with others

Like this thread? Share it with others

Posting Permissions

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


DMCA.com