Simple Excel Question

  • Thread starter Thread starter Mike
  • Start date Start date
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
 
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
 
Mike,

Haha!

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

~jaeson
 
Back
Top