+ Reply to Thread
Results 1 to 21 of 21

VBA codes auto numbering in clolumn A when the user enters information in an adjacent cell

  1. #1
    Registered User
    Join Date
    10-08-2011
    Location
    Hanoi Vietnam
    MS-Off Ver
    Excel 2010
    Posts
    46

    VBA codes auto numbering in clolumn A when the user enters information in an adjacent cell

    Hi Everyone,

    Could you please help send me VBA Codes to enable VBA codes auto numbering (1, 2, 3, ....) in clolumn A (A2, A3, A4, ...) when the user enters information in an adjacent cell let's say B2, B3, B4, ....?

    Thanks and Kind Regards,

  2. #2
    Valued Forum Contributor
    Join Date
    12-02-2012
    Location
    Melbourne, VIC
    MS-Off Ver
    Excel 2016
    Posts
    750

    Re: VBA codes auto numbering in clolumn A when the user enters information in an adjacent

    try this
    Please Login or Register  to view this content.

  3. #3
    Registered User
    Join Date
    10-08-2011
    Location
    Hanoi Vietnam
    MS-Off Ver
    Excel 2010
    Posts
    46

    Re: VBA codes auto numbering in clolumn A when the user enters information in an adjacent

    Thank so much jewelsharma,

    Could you please provide me with the sufficient codes that enable deleting the numbers already fill in cells in column A when the corresponding values in cells in column B are deleted?

    Best Regards,

  4. #4
    Valued Forum Contributor
    Join Date
    12-02-2012
    Location
    Melbourne, VIC
    MS-Off Ver
    Excel 2016
    Posts
    750

    Re: VBA codes auto numbering in clolumn A when the user enters information in an adjacent

    is the above code not doing so already? it is supposed to.

  5. #5
    Registered User
    Join Date
    10-08-2011
    Location
    Hanoi Vietnam
    MS-Off Ver
    Excel 2010
    Posts
    46

    Re: VBA codes auto numbering in clolumn A when the user enters information in an adjacent

    Hi jewelsharma,

    The codes only generate numbers, not delete the generated numbers relevant to the deleted values in column B.

    Could you please help me?

    Thanks

  6. #6
    Valued Forum Contributor
    Join Date
    12-02-2012
    Location
    Melbourne, VIC
    MS-Off Ver
    Excel 2016
    Posts
    750

    Re: VBA codes auto numbering in clolumn A when the user enters information in an adjacent

    see attached.
    Attached Files Attached Files

  7. #7
    Registered User
    Join Date
    10-08-2011
    Location
    Hanoi Vietnam
    MS-Off Ver
    Excel 2010
    Posts
    46

    Re: VBA codes auto numbering in clolumn A when the user enters information in an adjacent

    Hi jewelsharma,

    Thank for your file, but I still see the numbers existing in column A after I delete some values in column B. I don't know how to do.

    Could you please help me?

    Thanks

  8. #8
    Valued Forum Contributor
    Join Date
    12-02-2012
    Location
    Melbourne, VIC
    MS-Off Ver
    Excel 2016
    Posts
    750

    Re: VBA codes auto numbering in clolumn A when the user enters information in an adjacent

    That's surprising! (I take it that you have enabled the macros).

    Are other forum members able to help us verify that the code is working as expected. i.e. Starting from cell B2:
    1. Provide a serial number in column A when anything is entered in the corresponding cell in column B.
    2. Delete the serial number in column A, if the corresponding cell in column B is deleted; and renumber the cells accordingly.

    Experts, here's the code for your quick review:
    Please Login or Register  to view this content.
    I have the same Excel version as OP and it's working as expected for me, but the OP reports issue with deletion of the serial number. Am I missing something?
    Attached Files Attached Files

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

    Re: VBA codes auto numbering in clolumn A when the user enters information in an adjacent

    Try
    Please Login or Register  to view this content.
    Last edited by jindon; 01-17-2016 at 10:24 PM. Reason: One line added

  10. #10
    Registered User
    Join Date
    10-08-2011
    Location
    Hanoi Vietnam
    MS-Off Ver
    Excel 2010
    Posts
    46

    Re: VBA codes auto numbering in clolumn A when the user enters information in an adjacent

    Thanks jindon

    It seems there are still something that need be refining to ensure your codes run well.

    Could you please check and help me?

    Thanks

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

    Re: VBA codes auto numbering in clolumn A when the user enters information in an adjacent

    Quote Originally Posted by wowow View Post
    Thanks jindon

    It seems there are still something that need be refining to ensure your codes run well.

    Could you please check and help me?

    Thanks
    How is it not working?

  12. #12
    Registered User
    Join Date
    10-08-2011
    Location
    Hanoi Vietnam
    MS-Off Ver
    Excel 2010
    Posts
    46

    Re: VBA codes auto numbering in clolumn A when the user enters information in an adjacent

    Actually, when I put the value in column B but not in the continuous row the continuos numbers is appear in the blank row. Furthermore, the numbers are still shown when I delete the value in the column B.

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

    Re: VBA codes auto numbering in clolumn A when the user enters information in an adjacent

    Upload a workbook with your desired reult.

    Your explanation is confusing us.

  14. #14
    Registered User
    Join Date
    10-08-2011
    Location
    Hanoi Vietnam
    MS-Off Ver
    Excel 2010
    Posts
    46

    Re: VBA codes auto numbering in clolumn A when the user enters information in an adjacent

    Hi Jindon,

    Please help me with the attached file where there is some details of requirements.

    Thanks
    Attached Files Attached Files

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

    Re: VBA codes auto numbering in clolumn A when the user enters information in an adjacent

    If an Invoice ref no. cell is filled, the corressponding and continuos item number is automatically filled. When any Invoice ref no. is deleted, the corresponding number is automatically deleted too and re-numbering the remaining numbers
    What do you mean by "corressponding and continuos item number is automatically filled"?

  16. #16
    Registered User
    Join Date
    10-08-2011
    Location
    Hanoi Vietnam
    MS-Off Ver
    Excel 2010
    Posts
    46

    Re: VBA codes auto numbering in clolumn A when the user enters information in an adjacent

    Hi jindon, "corresponding and continuous item number is automatically filled" mean that the continuous and integral numbers only and these numbers are automatically generated by Excel itself. Thanks

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

    Re: VBA codes auto numbering in clolumn A when the user enters information in an adjacent

    Do you just want to number in col.A only the cell(s) col.B has value?
    Is that what you mean?

  18. #18
    Registered User
    Join Date
    10-08-2011
    Location
    Hanoi Vietnam
    MS-Off Ver
    Excel 2010
    Posts
    46

    Re: VBA codes auto numbering in clolumn A when the user enters information in an adjacent

    I just want to number in cell(s) of col A in case the corresponding cell(s) of col B has/have value(s).

    When the value(s) in cell(s) of col B is/are deleted, the corresponding number in cell(s) of col A is/are automatically removed.

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

    Re: VBA codes auto numbering in clolumn A when the user enters information in an adjacent

    Please Login or Register  to view this content.

  20. #20
    Registered User
    Join Date
    10-08-2011
    Location
    Hanoi Vietnam
    MS-Off Ver
    Excel 2010
    Posts
    46

    Re: VBA codes auto numbering in clolumn A when the user enters information in an adjacent

    It works! Thanks jindon. Good day.

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

    Re: VBA codes auto numbering in clolumn A when the user enters information in an adjacent

    If that takes care of your original question, please select Thread Tools from the menu link above and mark this thread as SOLVED.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. lock cell and/or message box after user enters data?
    By ashtally in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 07-21-2015, 04:56 AM
  2. Replies: 5
    Last Post: 06-22-2014, 08:27 PM
  3. Popup message showing adjacent cell value when user enters value in cell
    By kevinkusman in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 12-05-2013, 12:21 PM
  4. Replies: 0
    Last Post: 10-30-2012, 03:48 PM
  5. [SOLVED] MsgBox popup when user enters a value in a cell
    By okelly in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 04-26-2012, 01:00 PM
  6. [SOLVED] Auto-fill cell based on adjacent cell information..
    By sans in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 10-17-2005, 07:05 PM
  7. [SOLVED] How to run a macro when user enters a value in a cell?
    By serdar in forum Excel General
    Replies: 5
    Last Post: 06-05-2005, 09:40 PM

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