Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi I am trying to create a sequential number generator in a workbook so that
each time it is accessed the next open cell will autofill with the next higher number. I need it to do this from 150 to 10,000. I've tried to create a couple macros, don't know much about pivot tables. Any help? Thanks |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi Larry,
one of the more experienced bods may be able to come up with something a little more elegant, but in the meantime this may help! Private Sub Workbook_Open() Range("A65536").End(xlUp).Offset(1, 0).Select Selection.Value = Selection.Offset(-1, 0).Value + 1 End Sub Put the above in the ThisWorkbook (rather than a module or Sheet), and it will enter the next number in line in the next empty cell in Col A. You'll need to put "150" in A1 to start it off. Each time the workbook is opened after this, the next cell down will complete with +1 on the previous. HTH DS "Larry" wrote: Hi I am trying to create a sequential number generator in a workbook so that each time it is accessed the next open cell will autofill with the next higher number. I need it to do this from 150 to 10,000. I've tried to create a couple macros, don't know much about pivot tables. Any help? Thanks |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Ds,
this works great. I have changed to require 1 - 5000 using several different numbers up to 800, each will identify a tab in a workbook set up by year, each tab represents data on a piece of equipment. I may even link the number generated to the tabs. Now I just have to open the page 800 times to set the numbers! Kidding, I think I will set the cells up to 800 first then go from there. I'm thinking I can relace A1 with the cell A800. Anyhoo, thanks a bunch, this will do the job. "DS" wrote: Hi Larry, one of the more experienced bods may be able to come up with something a little more elegant, but in the meantime this may help! Private Sub Workbook_Open() Range("A65536").End(xlUp).Offset(1, 0).Select Selection.Value = Selection.Offset(-1, 0).Value + 1 End Sub Put the above in the ThisWorkbook (rather than a module or Sheet), and it will enter the next number in line in the next empty cell in Col A. You'll need to put "150" in A1 to start it off. Each time the workbook is opened after this, the next cell down will complete with +1 on the previous. HTH DS "Larry" wrote: Hi I am trying to create a sequential number generator in a workbook so that each time it is accessed the next open cell will autofill with the next higher number. I need it to do this from 150 to 10,000. I've tried to create a couple macros, don't know much about pivot tables. Any help? Thanks |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Thanks DS,
I think this will do nicely. I have changed my range to:1-5000. I need to use various numbers between 1-800 so I think I will populate the cells first and change A1 to A800; should start from there? Anyhoo, I appreciate the quick response. Take care, larry "DS" wrote: Hi Larry, one of the more experienced bods may be able to come up with something a little more elegant, but in the meantime this may help! Private Sub Workbook_Open() Range("A65536").End(xlUp).Offset(1, 0).Select Selection.Value = Selection.Offset(-1, 0).Value + 1 End Sub Put the above in the ThisWorkbook (rather than a module or Sheet), and it will enter the next number in line in the next empty cell in Col A. You'll need to put "150" in A1 to start it off. Each time the workbook is opened after this, the next cell down will complete with +1 on the previous. HTH DS "Larry" wrote: Hi I am trying to create a sequential number generator in a workbook so that each time it is accessed the next open cell will autofill with the next higher number. I need it to do this from 150 to 10,000. I've tried to create a couple macros, don't know much about pivot tables. Any help? Thanks |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
number generator | Excel Discussion (Misc queries) | |||
Random number Generator | New Users to Excel | |||
NUMBER SEQUENCE GENERATOR | New Users to Excel | |||
same number appears in a random number generator | Excel Worksheet Functions | |||
Random number generator | Excel Worksheet Functions |