Setting the row height based on a cell value

D

dcl

I want to set the row height of all rows after after a certain row based on
the value of a cell within each row.

Can anyone give me the VB to do this?

Thanks
 
A

Ayush Jain

If you want to set row height based on the values in Column B,you can
use the below code to do the same.

Sub Macro1()
For i = 1 To 20
If Range("B" & i).Value <> "" Then
ActiveSheet.Rows(i & ":" & i).RowHeight = Range("B" & i).Value
End If
Next
End Sub

Cheers :)

-Ayush Jain
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top