+ Reply to Thread
Results 1 to 4 of 4

Thread: macro to add to text in a cell

  1. #1
    Registered User
    Join Date
    10-25-2010
    Location
    Minnesota
    MS-Off Ver
    Excel 2007
    Posts
    5

    macro to add to text in a cell

    I need a macro that will let me change multiple text fields sequentially in a column from starting with "01", "02", etc., to "201", "202", etc., or whatever number I need them to. I want the macro to affect only the cell I have selected, and I'd like to be able to edit the macro so that I can change the beginning "2" to a "3" or "4" when the time comes. Thank you.

  2. #2
    Forum Moderator davesexcel's Avatar
    Join Date
    02-19-2006
    Location
    Cochrane,Alberta
    MS-Off Ver
    XL 2003,2007,2010
    Posts
    6,843

    Re: macro to add to text in a cell

    You need to be more clear...How is anybody to know what number you need them to be?

    To best describe or illustrate your problem you would be better off attaching a dummy workbook, the workbook should contain the same structure and some dummy data of the same type as the type you have in your real workbook - so, if a cell contains numbers & letters in this format abc-123 then that should be reflected in the dummy workbook.

    If needed supply a before and after sheet in the workbook so the person helping you can see what you are trying to achieve.

    Doing this will ensure you get the result you need!

  3. #3
    Registered User
    Join Date
    10-25-2010
    Location
    Minnesota
    MS-Off Ver
    Excel 2007
    Posts
    5

    Re: macro to add to text in a cell

    Forget it. Twice I've posted, twice I've been told I'm doing something wrong just with my POST! I feel my description has been quite clear both times, but I am not comfortable with such a rigid and unfriendly environment that this forum appears to offer. I'll delete my account and just ask someone locally.

  4. #4
    Forum Guru romperstomper's Avatar
    Join Date
    11-04-2008
    Location
    Apparently I can't say
    MS-Off Ver
    Apparently I can't say
    Posts
    8,274

    Re: macro to add to text in a cell

    If you're not prepared to respond to a request for clarification, how do you expect us to help? We can't do what we don't understand.
    For example, you said you want to change multiple text fields, but also that the macro should only affect the cell you have selected. That seems contradictory.

    If you just want a sequence of numbers, why not use formulas instead. Simply enter your start number in a cell, say A1, then in the cells underneath use a formula like:
    =TEXT(A1+1,"000")
    and copy down as far as required. Then if you cahnge A1, the rest will follow automatically.

    If that's not what you need, then I'm afraid you will have to elaborate a little.

+ 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.2.0