+ Reply to Thread
Results 1 to 10 of 10

Auto Numbering a Tag name

  1. #1
    Registered User
    Join Date
    11-21-2007
    Posts
    32

    Auto Numbering a Tag name

    Hello all

    I would like to know if there is a way to Auto number a text.
    I have a column with text tags (lets say Column B). These cells look at a specific cell (ex. A1) and see what text is written in it then copy the text into their own cells B1, B2, B3 and so on. So if cell A1 reports AAA then Column B cells become AAA all the way down.
    Now what I like to do is for column B cells look at A1, copy the text and add _01 infront of their copied text. so for Column B, B1 reports AAA_01, B2 is AAA_02, B3 is AAA_03 and so on

    What code should I use to do this?

    Cheers

    ADSK

  2. #2
    Forum Guru
    Join Date
    08-05-2004
    Location
    NJ
    MS-Off Ver
    365
    Posts
    13,582
    Sure! If you are starting in Row 1, then the formula would be
    Please Login or Register  to view this content.
    If it's not starting in Row 1, then subtract the appropriate number from ROW()as necessary to get the proper results.

    ChemistB

  3. #3
    Forum Contributor VBA Noob's Avatar
    Join Date
    04-25-2006
    Location
    London, England
    MS-Off Ver
    xl03 & xl 07(Jan 09)
    Posts
    11,988
    Maybe

    =IF(A1="","",A1&"_"&TEXT(COUNTA($A$1:A1),"00"))
    VBA Noob
    _________________________________________


    Credo Elvem ipsum etian vivere
    _________________________________________
    A message for cross posters

    Please remember to wrap code.

    Forum Rules

    Please add to your signature if you found this link helpful. Excel links !!!

  4. #4
    Registered User
    Join Date
    11-21-2007
    Posts
    32
    Thank you both.

  5. #5
    Registered User
    Join Date
    11-21-2007
    Posts
    32
    Ok few problems;

    =A1&"-"&ROW()
    This code looks at the Row Number and uses the row number infront of the text. I like to have _01, _02 regardless of what the row number is.


    =IF(A1="","",A1&"_"&TEXT(COUNTA($A$1:A1),"00"))
    This one works except it reports all cells as the same number. is there a way I can make it look for existing number then generate a new number? for example if I used AAA_01 in cell B1, then next tsxt uses AAA_02?

    ADSK

  6. #6
    Forum Contributor VBA Noob's Avatar
    Join Date
    04-25-2006
    Location
    London, England
    MS-Off Ver
    xl03 & xl 07(Jan 09)
    Posts
    11,988
    This one works except it reports all cells as the same number
    ??.

    The formula works as follows

    If A1 = AAA then B1 equals AAA_01
    then if A2 = AAA then B2 equals AAA_02

    or
    if A1 = AAA then B1 equals AAA_01
    If A3 = AAA then B3 equals AAA_02

    VBA Noob

  7. #7
    Registered User
    Join Date
    11-21-2007
    Posts
    32
    If A1 = AAA then B1 equals AAA_01
    then if A2 = AAA then B2 equals AAA_02
    or
    if A1 = AAA then B1 equals AAA_01
    If A3 = AAA then B3 equals AAA_02

    Yes it works the way you said, but my problem is that all cells in column B look at only A1. I do not have A2 or A3.
    All cells look at A1, copy its text to their cells and add _01, _02 infront of their copied text. I amsorry that Ididn't explain it properly.

    ADSK

  8. #8
    Forum Contributor VBA Noob's Avatar
    Join Date
    04-25-2006
    Location
    London, England
    MS-Off Ver
    xl03 & xl 07(Jan 09)
    Posts
    11,988
    Maybe

    =$A$1&"_"&TEXT(ROW(A1),"00")
    VBA Noob

  9. #9
    Forum Guru
    Join Date
    08-05-2004
    Location
    NJ
    MS-Off Ver
    365
    Posts
    13,582
    Hmmm, I'm confused.

    It looks like VBA's formula does what you want. (Mine would work only if there are no blank spaces). Can you give a short example of what would be in column A and what you would expect in Column B? The example you gave so far seems to indicate that all the values in Column A would be identical (AAA).

    ChemistB

  10. #10
    Registered User
    Join Date
    11-21-2007
    Posts
    32
    Sure,

    Here is a screen shot of what I need. I have 2 sheets side by side. Some notes are added and are in Red.

    Thank you
    Attached Images Attached Images

+ 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