If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
Sequential Numbering
Hi
I use Excel 2000 with a Windows 2000 operating system. I would like to have an excel file that when I open it up, it generates a sequential number in cell A1. Is there a template maybe that I could use for this? or maybe someone can explain how to do it. Any advice is much appreciated. John Calder |
#2
|
|||
|
|||
Sequential Numbering
Hi
this would require VBA. You may put the following code in your workbook module (not in a standard module): Private Sub Workbook_Open() with me.worksheets("sheet1").range("A1") .value = .value+1 end with End Sub -- Regards Frank Kabel Frankfurt, Germany John Calder wrote: Hi I use Excel 2000 with a Windows 2000 operating system. I would like to have an excel file that when I open it up, it generates a sequential number in cell A1. Is there a template maybe that I could use for this? or maybe someone can explain how to do it. Any advice is much appreciated. John Calder |
#3
|
|||
|
|||
Sequential Numbering
Thanks for your help with this Frank.
I think I can get it into a module alright but I am not sure what you mean by (not in a standard module) Any chance you could explain this to me. John Calder -----Original Message----- Hi this would require VBA. You may put the following code in your workbook module (not in a standard module): Private Sub Workbook_Open() with me.worksheets("sheet1").range("A1") .value = .value+1 end with End Sub -- Regards Frank Kabel Frankfurt, Germany John Calder wrote: Hi I use Excel 2000 with a Windows 2000 operating system. I would like to have an excel file that when I open it up, it generates a sequential number in cell A1. Is there a template maybe that I could use for this? or maybe someone can explain how to do it. Any advice is much appreciated. John Calder . |
#4
|
|||
|
|||
Sequential Numbering
Hi
In this cas this has to go in your workbook moudle: - opne the VBA editor with aKT+F11 - locate 'ThisWorkbook' in the left explorer tree view - double click on this entry - paste the code in the appearing editor window. You may also take a look at: http://www.cpearson.com/excel/events.htm -- Regards Frank Kabel Frankfurt, Germany "John Calder" schrieb im Newsbeitrag ... Thanks for your help with this Frank. I think I can get it into a module alright but I am not sure what you mean by (not in a standard module) Any chance you could explain this to me. John Calder -----Original Message----- Hi this would require VBA. You may put the following code in your workbook module (not in a standard module): Private Sub Workbook_Open() with me.worksheets("sheet1").range("A1") .value = .value+1 end with End Sub -- Regards Frank Kabel Frankfurt, Germany John Calder wrote: Hi I use Excel 2000 with a Windows 2000 operating system. I would like to have an excel file that when I open it up, it generates a sequential number in cell A1. Is there a template maybe that I could use for this? or maybe someone can explain how to do it. Any advice is much appreciated. John Calder . |
#5
|
|||
|
|||
Sequential Numbering
One alternative is to just right-click on the Excel icon,
(which is just to the left of "File" on the standard menu bar) then choose "View code" This will also bring you direct to the This Workbook module in VBE -- Rgds Max xl 97 -- Please respond, in newsgroup xdemechanik atyahoodotcom --- |
Thread Tools | |
Display Modes | |
|
|