Auto-number adding

Beckwa

New Member
Joined
Mar 12, 2002
Messages
33
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 :biggrin::D:D
 

Excel Facts

What is =ROMAN(40) in Excel?
The Roman numeral for 40 is XL. Bill "MrExcel" Jelen's 40th book was called MrExcel XL.
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
 
Upvote 0
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
 
Upvote 0
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
 
Upvote 0

Forum statistics

Threads
1,214,585
Messages
6,120,399
Members
448,957
Latest member
Hat4Life

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top