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

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

routes - Laravel 4 Wildcard Routing to Different Controllers -

cross browser - XSLT namespace-alias Not Working in Firefox or Chrome -