Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 159
Default number sequence generator

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   Report Post  
Posted to microsoft.public.excel.programming
DS DS is offline
external usenet poster
 
Posts: 117
Default number sequence generator

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 159
Default number sequence generator

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 159
Default number sequence generator

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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
number generator how can i sequence the middle numbers Excel Discussion (Misc queries) 2 November 10th 08 11:01 PM
Random number Generator RayT New Users to Excel 14 January 15th 08 11:16 PM
NUMBER SEQUENCE GENERATOR Timbo New Users to Excel 1 June 27th 07 05:10 PM
same number appears in a random number generator Carmel Excel Worksheet Functions 4 May 28th 06 12:22 AM
Random number generator Philippe L. Balmanno Excel Worksheet Functions 4 December 17th 04 07:42 AM


All times are GMT +1. The time now is 10:43 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"