excel - Populating row headers with numbers till a certain criteria -
i'm trying create macro populate worksheet's row headers labeling them box numbers like:
box 1
box 2
box 3
... , on.
the number of boxes in sheet. if number written there 8, possible populate other sheet's rows box 1 box 8?
am making sense?
thanks.
if need fancier asked for, may need resort vba. if not, following works:
- create new excel file 2 sheets.
- on 2nd worksheet, in cell a1, enter number 10
on 1st worksheet, in cell a1, enter formula:
=if(column()<=sheet2!$a$1,"box " & column(), "")
on 1st worksheet, select a1.
- press ctrl-shft-right (this select entire row)
- press ctrl-r (this fill formula right)
this works because column() returns current column number (a1, a2, a3 return 3. b1, b2, b3 return 2).
a simple comparison between value in sheet2 , current column() value gives 1, 2, 3... whatever entered sheet2.
Comments
Post a Comment