View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
StargateFanFromWork StargateFanFromWork is offline
external usenet poster
 
Posts: 27
Default Populating a cell with numbers without numbers being formula-based??

This is something I've run across again and again that I hope to now get a
solution for. Most of the time, I use =ROW-1, or a variation thereof, to
get column A to show numbers 1 to whatever, depending on the # of rows in a
print area.

However, every once in a while numbers _must_ still display sequentially,
but must be "real" numbers. So instead of =ROW-1 showing in a cell, one
would see an actual #, 1, 2, 3, 4 ... etc. I've always had to type these in
manually. Today I had to type in up to row 100!

My question is if it's possible to programmatically dump the numbers in in a
selected number of cells downwards in column A?? i.e., if I were to select
from A2 to A51, for example, could the macro start filling in the cells
numerically - A2 would then have a 1 in it, A3 would have 2, A4 would have
3, etc., etc.?

This would be a god-send, if it were possible to do.

I just got to thinking, what if the case were of running out of rows in a
spreadsheet? Let's say a sheet that reached row #A51 which had number 50 in
it. I'd have to add rows after that point. If I added 50 more rows and
then selected A52 to A101, would there be a way to have the macro then
populate the cells from 51 to 100? To do both, starting from 1 like the
above case, or starting from 51 like this second case, I'm guessing it would
be a matter of prompting the user for the starting number to begin the
numbering (?).

Just a thought. I don't know if this can be done, but it would save so much
grief and time and would save some poor fingers! <g

Thanks!