![]() |
![]() |
|
|||||||
| Excel Questions All Excel/VBA questions - formulas, macros, pivot tables, general help, etc. Please post to this forum in English only. |
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
New Member
Join Date: Mar 2002
Location: Northampton, UK
Posts: 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
|
|
|
|
|
|
#2 |
|
MrExcel MVP
Join Date: Feb 2002
Location: Monterrey, Mexico
Posts: 1,433
|
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 |
|
New Member
Join Date: Mar 2002
Location: Northampton, UK
Posts: 33
|
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
|
|
|
|
|
|
#4 |
|
Legend
Join Date: Feb 2002
Location: Minneapolis, Mn, USA
Posts: 9,704
|
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 |
|
|
|
![]() |
| Bookmarks |
| Thread Tools | |
| Display Modes | |
|
|