Results 1 to 2 of 2
  1. #1
    Join Date
    Nov 2013
    Posts
    2

    Smile Unanswered: Sequential line numbering

    Hello,

    I record purchase orders placed into an excel sheet. Currently we print off orders and then write them out and they get typed up at the end of the day. In this way the order numbers get typed into column B of the spreadsheet.

    What I want to do is have a macro that i can run that will find the next blank cell in that column and then generate the next available number from a sequence. This will allow me to bypass the paper and speed up the task.

    So far I can find the blank cell using this

    Sheets("Orders Placed").Select
    Columns("B:B").Select
    Range("B1").End(xlDown).Offset(1, 0).Select

    The number range will change depeding on who is using it. So for example if I used a short cut like Ctrl S for my orders then I would want the range to be 30400-39999 but one of my colleagues would be on a different shortcut and their range would be 10400-10999.

    Any help would be appreciated.


    Thanks

  2. #2
    Join Date
    Nov 2013
    Posts
    2

    Update

    Just to add. I would most likely need the macro to check the highest number in the given sequence first and then generate the next one.

    I was thinking at first that the macro could look at all the lines above and find the highest number and add 1. However, because we all use different ranges, some higher than others then this would cause problems.

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •