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:

  1. create new excel file 2 sheets.
  2. on 2nd worksheet, in cell a1, enter number 10
  3. on 1st worksheet, in cell a1, enter formula:

    =if(column()<=sheet2!$a$1,"box " & column(), "")

  4. on 1st worksheet, select a1.

  5. press ctrl-shft-right (this select entire row)
  6. 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

Popular posts from this blog

sql - VB.NET Operand type clash: date is incompatible with int error -

SVG stroke-linecap doesn't work for circles in Firefox? -

python - TypeError: Scalar value for argument 'color' is not numeric in openCV -