+ Reply to Thread
Results 1 to 7 of 7

Macro to add prefix and increment?

  1. #1
    Registered User
    Join Date
    01-25-2009
    Location
    Florida, USA
    MS-Off Ver
    Excel 2003
    Posts
    78

    Macro to add prefix and increment?

    I have a list of text in B2

    is it possible to create a macro to add a prefix and an incremental value?

    as an example, from this:

    This is the first line of text
    This is the second line of text
    This is the third line of text
    This is the fourth line of text

    to this:

    Prefix.001.00.This is the first line of text
    Prefix.002.00.This is the second line of text
    Prefix.003.00.This is the third line of text
    Prefix.004.00.This is the fourth line of text

    Thanks for any help


    Jeff

  2. #2
    Forum Guru :) Sixthsense :)'s Avatar
    Join Date
    01-01-2012
    Location
    India>Tamilnadu>Chennai
    MS-Off Ver
    2003 To 2010
    Posts
    12,770

    Re: Macro to add prefix and increment?

    Using formula...

    In A1 Cell
    This is the first line of text

    In B1 Cell
    Formula: copy to clipboard
    Please Login or Register  to view this content.


    Drag it down..


    If your problem is solved, then please mark the thread as SOLVED>>Above your first post>>Thread Tools>>
    Mark your thread as Solved


    If the suggestion helps you, then Click *below to Add Reputation

  3. #3
    Registered User
    Join Date
    01-25-2009
    Location
    Florida, USA
    MS-Off Ver
    Excel 2003
    Posts
    78

    Re: Macro to add prefix and increment?

    Awesome!

    Thank you very much


    Jeff

  4. #4
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,670

    Re: Macro to add prefix and increment?

    UDF

    C2
    =AddPrefix(B2,"Prefix")

    To a standard module
    Please Login or Register  to view this content.

  5. #5
    Registered User
    Join Date
    01-25-2009
    Location
    Florida, USA
    MS-Off Ver
    Excel 2003
    Posts
    78

    Re: Macro to add prefix and increment?

    Thanks Jindon!

    Can this be converted to a macro?

    Jeff

  6. #6
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,670

    Re: Macro to add prefix and increment?

    Is this what you mean?
    Please Login or Register  to view this content.

  7. #7
    Registered User
    Join Date
    01-25-2009
    Location
    Florida, USA
    MS-Off Ver
    Excel 2003
    Posts
    78

    Re: Macro to add prefix and increment?

    Thanks Jindon!!

+ 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