View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Dick Kusleika[_4_] Dick Kusleika[_4_] is offline
external usenet poster
 
Posts: 595
Default Repost: Any way to do this with a range?

Ed

How is the data getting into Excel? If you set all the row heights to 25.5
before the data is entered, then only those rows that need it should expand.
I didn't test that though. If you can't set the row height before the data,
then I think you're stuck with iterating through them.

--
Dick Kusleika
MVP - Excel
Excel Blog - Daily Dose of Excel
www.dicks-blog.com

"Ed" wrote in message
...
I create a spreadsheet using code. Several columns are formatted with

Wrap
Text on, so if there is a lot of text, the row expands to handle it. If
there isn't, though, I wind up with some comparatively skinny rows. I

would
like to set all my rows heights to at least 25.5; if, however, text in the
row is making row height greater then 25.5, don't touch it. (Several
answers to the first post gave me code to set every row to 25.5. Thank

you,
but that will set expanded too narrow to read all the text inside.)

At the moment, the only way I can think of to accomplish this is by
iterating through every row using the code below. That's a lot of time

over
several thousand rows. Is there a faster way to accomplish this using a
range?

Ed

For iRow = numRow To 2 Step -1
If Rows(iRow).RowHeight < 25.5 Then
Rows(iRow).RowHeight = 25.5
End If
Next iRow