Auto-number adding
MZ Tools makes life easier for the Excel VBA coder
Thanks Thanks:  0
Likes Likes:  0
Results 1 to 4 of 4

Thread: Auto-number adding

  1. #1
    New Member
    Join Date
    Mar 2002
    Location
    Northampton, UK
    Posts
    33
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

     
    For the booking system I am doing I have set up a workbook containing a booking form worksheet. In this I have a cell for the booking number to go in. I want this number to automatically change every time a new booking form is opened for data entry. A formula was suggested by a friend =SUM(previous number +1) But this wouldn't work - any ideas at all?!?!?!?! cos i'm stuck!! Thanks so much, Bex :D:D

  2. #2
    MrExcel MVP Al Chara's Avatar
    Join Date
    Feb 2002
    Location
    Newark, Delaware
    Posts
    1,701
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    I am a little confused. Do you want the booking number to update everytime you open the workbook or everytime a worksheet is added?

    If you wanted updated everytime you open hte workbook then put this code in the code for the workbook:
    Private Sub Workbook_Open()
    Worksheets("booking form").Range("a1").Value= Worksheets("booking form").Range("a1").Value + 1
    End Sub

    Where booking form is the name of your booking form worksheet and a1 is the cell where you want the booking number.

    I hope this helps,
    Kind regards, Al

    [ This Message was edited by: Al Chara on 2002-03-14 09:44 ]

  3. #3
    New Member
    Join Date
    Mar 2002
    Location
    Northampton, UK
    Posts
    33
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    I would like it to update each time the Booking Form worksheet is opened idealy! Is it even possible? or am i making things up BEX x

  4. #4
    Legend NateO's Avatar
    Join Date
    Feb 2002
    Location
    Minneapolis, Mn, USA
    Posts
    9,700
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

      
    Every time you select a certain sheet? Right click on the worksheet, select "view code" and paste:

    Private Sub worksheet_activate()
    Worksheets("booking form").Range("a1").Value= Worksheets("booking form").Range("a1").Value + 1
    End Sub


User Tag List

Like this thread? Share it with others

Like this thread? Share it with others

Posting Permissions

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

 

 
DMCA.com