Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
Greeting,
I have work book and I need this work book generates an auto number. For example, when I open this sheet for the first time, A1 =1, next time =2 and so on. Is that possible in excel??? Thanks!! |
#2
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
Put in ThisWorkbook module
Private Sub Workbook_Open() [A1]=[A1]+1 End Sub "ghost" skrev: Greeting, I have work book and I need this work book generates an auto number. For example, when I open this sheet for the first time, A1 =1, next time =2 and so on. Is that possible in excel??? Thanks!! |
#3
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
Add this code in excel:
Private Sub Workbook_Open() Dim i As Integer Dim iValue As Integer Dim iStart As Integer Dim iIncrement As Integer i = 1 iStart = 1 'Here you can define the starting value iIncrement = 1 'Here you can define the incremenatal value If Cells(1, 1).Value = "" Then Cells(1, 1).Value = iStart Else While Cells(i, 1).Value < "" iValue = Cells(i, 1).Value i = i + 1 Wend Cells(i, 1).Value = iValue + iIncrement End If ActiveWorkbook.Save End Sub Thanks, Mahesh "ghost" wrote: Greeting, I have work book and I need this work book generates an auto number. For example, when I open this sheet for the first time, A1 =1, next time =2 and so on. Is that possible in excel??? Thanks!! |
#4
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
it works.
thanks a lot "Mahesh" wrote: Add this code in excel: Private Sub Workbook_Open() Dim i As Integer Dim iValue As Integer Dim iStart As Integer Dim iIncrement As Integer i = 1 iStart = 1 'Here you can define the starting value iIncrement = 1 'Here you can define the incremenatal value If Cells(1, 1).Value = "" Then Cells(1, 1).Value = iStart Else While Cells(i, 1).Value < "" iValue = Cells(i, 1).Value i = i + 1 Wend Cells(i, 1).Value = iValue + iIncrement End If ActiveWorkbook.Save End Sub Thanks, Mahesh "ghost" wrote: Greeting, I have work book and I need this work book generates an auto number. For example, when I open this sheet for the first time, A1 =1, next time =2 and so on. Is that possible in excel??? Thanks!! |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
A number of auto filters in one sheet. | Excel Discussion (Misc queries) | |||
A number of auto filters in one sheet? Is it possible? | Excel Discussion (Misc queries) | |||
Excel worksheet - Can I make changes in one sheet affect contents of other sheet? | Excel Discussion (Misc queries) | |||
cutting and pasting rows from one sheet to another generates error | Excel Discussion (Misc queries) | |||
Excel Analysis Add-in EOMONTH generates #NAME? error | Excel Worksheet Functions |