Change row height

B

bergjes

Hi,
I'm a newbie with excel programming, but can somebody help me with the
following.

I have a rather large worksheet from wich I have to change the row
height to 15, but only the rows that have a height of 13.75.

Is there anyway I can do that with a macro or vsb?

Thanks,
Erik
 
N

Nigel

You can test the row height as well as set it, so try this.......

Sub RowH()
With Sheets("Sheet1").UsedRange
If .RowHeight = 13.75 Then .RowHeight = 15
End With
End Sub
 
G

Guest

Here you go, please note that if there are a lot then this could take some
time. If you could narrow the area to do this to it would speed it up.
Sub main()
myrow = 1
Do Until myrow = Cells(Rows.Count, "A").End(xlDown).Row
If Rows(myrow).RowHeight = 13.75 Then Rows(myrow).RowHeight = 15
myrow = myrow + 1
Loop
End Sub
 
G

Guest

Forgot to mention that this formats the entire page, if you just want to go
until there is no more data change the column that contains the data and the
line given to xlUp like this
Do Until myrow = Cells(Rows.Count, "C").End(xlUp).Row
 
B

bergjes

Thanks John,

works great!!!!

Just a little remark, your macro left out the last row with data.
But hé, it works for me, thanks again.

Erik



John Bundy schreef:
 
B

bergjes

Hi Nigel,

Thanks for your response, but I can't get it working.
The solution from John works great, but i'm just curious if your
solution works as well.

If I put your code into my sheet, nothing happens.

Did it work for you?

Erik


Nigel schreef:
 

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

Similar Threads

Minimum row height 1
Row Height 4
Control Row Height 5
How to know the correct height of the row 2
Creating a Macro to adjust the row heights 7
Minimum row height 8
Row Height -- Slows VBA 7
Row Height and Printing 2

Top