loops - Run VBA format code on all sheets with different number of rows -
vba noob here needs little bit of assistance. cannot seem find solution or work.
i've tried simplify as proof of concept.
the basic idea format 1 cell (a1 say) borders, copy format down across data in first sheet (a1:c10 example), same data in subsequent sheets. i'm struggling subsequent sheets have different number of rows , try formats additional sheets (a1:c10) of original if there no data present.
any appreciated.
what need variable identifies last row of given sheet. instance
lastrow = worksheets("sheet1").cells(65000,1).end(xlup).row
now can loop through cells
for = 1 lastrow j = 1 3 worksheets("sheet1").cells(i, j) (apply formatting) next j next
Comments
Post a Comment