row height - Excel VBA rowheigt from value in range -
i have excel-sheet values in column d. set row height in relation value of cell d of each row. values in d small %-values 0.0593 %, except of first (d4 = 31 %) , last (d92 = 40 %)
to small values @ reasonable height i'd multiply them 10'000 - there comes problem 409 max height.
i have script works until comes high values tried if formula. frankly: have no idea doing here... copied together.
so problems: working in range of d5-d91 , if value should go on 409 give him 15px.
thanx help!
private sub worksheet_selectionchange(byval target range) dim long = 4 cells(rows.count, 1).end(xlup).row - 1 cells(i, 4) if .cells(i, 4).value * 10000 > 409 rows(i).rowheight = 12 else rows(i).rowheight = cells(i, 4).value * 10000 end if end next end sub
copy below code standard module & run. may have tweak code per requirement.
sub sample() dim long = 4 cells(rows.count, 1).end(xlup).row if cells(i, 4).value * 10000 > 409 rows(i).rowheight = 12 else rows(i).rowheight = cells(i, 4).value * 10000 end if next end sub
Comments
Post a Comment