Simple Excel Question

M

Mike

Hi everyone,

Sa you have this in cell A1 a max value of 10. In B column I then
have:
1
2
3
4
5
6
7
8
9
10

Now, assume the max value in cell A1 is 5 or 20 instead. I want the
numbers automaticall to be listed from 1-to-5 or from 1-to- 20...and
so on.

How can I auotomate this?

Thanks,
Mike
 
J

joeu2004

assume the max value in cell A1 is 5 or 20 instead. I want the
numbers automaticall to be listed [in column B] from 1-to-5 or
from 1-to- 20...and so on. How can I auotomate this?

Perhaps the easiest way.... Put 1 into the first cell in column B,
say B1, then put the following into next cell in column B and copy
down for as many rows as you think A1 will ever be, say B100: =IF(B1>=
$A$1,"",B1+1)

If you do not want to overpopulate column B with needless formulas,
you could have a macro. For example:

Sub fillB()
Dim i As Long
For i = 1 To Range("a1")
Range("b1").Cells(i) = i
Next i
End Sub
 
D

DCG-jaeson

Mike,

Haha!

The simpliest way I can suggest is Sort the coloum itself arranged by
Ascending.

~jaeson
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top