+ Reply to Thread
Results 1 to 7 of 7

create simple macro

Hybrid View

  1. #1
    Registered User
    Join Date
    02-11-2006
    Posts
    3

    create simple macro

    I have one column of 500 numbers similar to this "cc03052" they all start with cc I need the macro to add "05" into the number at a specific point then to go the next.

    before after
    cc03052 cc0305052
    cc04130 cc0412050

    can anyone help me
    Last edited by noraisens; 02-11-2006 at 03:12 PM.

  2. #2
    Registered User
    Join Date
    02-11-2006
    Posts
    3
    [QUOTE=noraisens]I have one column of 500 numbers similar to this "cc03052" they all start with cc I need the macro to add "05" into the number at a specific point then to go the next.

    before after
    cc03052 cc0305052
    cc04130 cc0412050

    can anyone help me
    thanks,
    Ron

  3. #3
    Don Guillett
    Guest

    Re: create simple macro

    You need to be a bit more specific. There doesn't seem to be a pattern here.

    --
    Don Guillett
    SalesAid Software
    dguillett1@austin.rr.com
    "noraisens" <noraisens.232x6y_1139685303.8615@excelforum-nospam.com> wrote
    in message news:noraisens.232x6y_1139685303.8615@excelforum-nospam.com...
    >
    > I have one column of 500 numbers similar to this "cc03052" they all
    > start with cc I need the macro to add "05" into the number at a
    > specific point then to go the next.
    >
    > before after
    > cc03052 cc0305052
    > cc04130 cc0412050
    >
    > can anyone help me
    >
    >
    > --
    > noraisens
    > ------------------------------------------------------------------------
    > noraisens's Profile:
    > http://www.excelforum.com/member.php...o&userid=31450
    > View this thread: http://www.excelforum.com/showthread...hreadid=511382
    >




  4. #4
    Nick Hodge
    Guest

    Re: create simple macro

    Don

    I took it the second one was a typo

    --
    HTH
    Nick Hodge
    Microsoft MVP - Excel
    Southampton, England
    www.nickhodge.co.uk
    nick_hodgeTAKETHISOUT@zen.co.uk.ANDTHIS


    "Don Guillett" <dguillett1@austin.rr.com> wrote in message
    news:OAMoNK0LGHA.2916@tk2msftngp13.phx.gbl...
    > You need to be a bit more specific. There doesn't seem to be a pattern
    > here.
    >
    > --
    > Don Guillett
    > SalesAid Software
    > dguillett1@austin.rr.com
    > "noraisens" <noraisens.232x6y_1139685303.8615@excelforum-nospam.com> wrote
    > in message news:noraisens.232x6y_1139685303.8615@excelforum-nospam.com...
    >>
    >> I have one column of 500 numbers similar to this "cc03052" they all
    >> start with cc I need the macro to add "05" into the number at a
    >> specific point then to go the next.
    >>
    >> before after
    >> cc03052 cc0305052
    >> cc04130 cc0412050
    >>
    >> can anyone help me
    >>
    >>
    >> --
    >> noraisens
    >> ------------------------------------------------------------------------
    >> noraisens's Profile:
    >> http://www.excelforum.com/member.php...o&userid=31450
    >> View this thread:
    >> http://www.excelforum.com/showthread...hreadid=511382
    >>

    >
    >




  5. #5
    Registered User
    Join Date
    02-11-2006
    Posts
    3

    more info

    Yes, the second post was a mistake.

    I have 6 columns with information.
    the second column has an id number with 2 letters and 5 numbers (ie: ccxxxxx). example: cc14081.
    I would like to make this id number bigger by adding 2 numbers in a specific place in the id number (ie: ccxxxx05x). example: cc1408051.

    I took the column of numbers and placed it in a new worksheet in column a

    i took the formula =LEFT(A1,6)&"05"&RIGHT(A1,1) and placed it in column b.

    I then copied it down and It worked. Thank you.

    can I recap what was done.

    LEFT(A1,6) in cell A1 go from the left 6 spaces
    &"05"& insert 05
    RIGHT(A1,1) in cell A1 go from the right 1 space and leave the digit in place.

    Is this correct?

    Is it possible to make this so that you can actually take the number out and replace it. as long as the column was identified?

    thanks,
    Ron

  6. #6
    Nick Hodge
    Guest

    Re: create simple macro

    Ron

    Left is taking the data from left of an input cell (A1) and then taking the
    first 'x' characters. Right doe the same from the right. The other one you
    have that could certainly be used to replace the number is MID

    =MID(CellRef,StartCharacter,NoCharactersToTakeFromStartCharacter)

    If that makes sense

    --
    HTH
    Nick Hodge
    Microsoft MVP - Excel
    Southampton, England
    www.nickhodge.co.uk
    nick_hodgeTAKETHISOUT@zen.co.uk.ANDTHIS


    "noraisens" <noraisens.2358an_1139793001.3205@excelforum-nospam.com> wrote
    in message news:noraisens.2358an_1139793001.3205@excelforum-nospam.com...
    >
    > Yes, the second post was a mistake.
    >
    > I have 6 columns with information.
    > the second column has an id number with 2 letters and 5 numbers (ie:
    > ccxxxxx). example: cc14081.
    > I would like to make this id number bigger by adding 2 numbers in a
    > specific place in the id number (ie: ccxxxx05x). example: cc1408051.
    >
    > I took the column of numbers and placed it in a new worksheet in column
    > a
    >
    > i took the formula =LEFT(A1,6)&"05"&RIGHT(A1,1) and placed it in column
    > b.
    >
    > I then copied it down and It worked. Thank you.
    >
    > can I recap what was done.
    >
    > LEFT(A1,6) in cell A1 go from the left 6 spaces
    > &"05"& insert 05
    > RIGHT(A1,1) in cell A1 go from the right 1 space and leave the digit in
    > place.
    >
    > Is this correct?
    >
    > Is it possible to make this so that you can actually take the number
    > out and replace it. as long as the column was identified?
    >
    > thanks,
    > Ron
    >
    >
    > --
    > noraisens
    > ------------------------------------------------------------------------
    > noraisens's Profile:
    > http://www.excelforum.com/member.php...o&userid=31450
    > View this thread: http://www.excelforum.com/showthread...hreadid=511382
    >




  7. #7
    Nick Hodge
    Guest

    Re: create simple macro

    Can you not use a formula?

    If the old values are in column A in B1 enter

    =LEFT(A1,6)&"05"&RIGHT(A1,1)

    And copy down. This presumes they (the old value) are all the same length.
    If not paste back

    --
    HTH
    Nick Hodge
    Microsoft MVP - Excel
    Southampton, England
    www.nickhodge.co.uk
    nick_hodgeTAKETHISOUT@zen.co.uk.ANDTHIS


    "noraisens" <noraisens.232x6y_1139685303.8615@excelforum-nospam.com> wrote
    in message news:noraisens.232x6y_1139685303.8615@excelforum-nospam.com...
    >
    > I have one column of 500 numbers similar to this "cc03052" they all
    > start with cc I need the macro to add "05" into the number at a
    > specific point then to go the next.
    >
    > before after
    > cc03052 cc0305052
    > cc04130 cc0412050
    >
    > can anyone help me
    >
    >
    > --
    > noraisens
    > ------------------------------------------------------------------------
    > noraisens's Profile:
    > http://www.excelforum.com/member.php...o&userid=31450
    > View this thread: http://www.excelforum.com/showthread...hreadid=511382
    >




+ 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