Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
Ed Ed is offline
external usenet poster
 
Posts: 399
Default Do using range vs. row iteration?

I'd like to set the height of all my rows to a certain minimum height. At
the moment, the only thing I can make work is to iterate through every row:
For iRow = numRow To 2 Step -1
If Rows(iRow).RowHeight < 25.5 Then
Rows(iRow).RowHeight = 25.5
End If
Next iRow

Is there a faster way to do this using a range?

Ed


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Do using range vs. row iteration?


this sets all rows in the active worksheet to 25.5

Cells.Select
Selection.rowheight = 25.

--
crispb
-----------------------------------------------------------------------
crispbd's Profile: http://www.excelforum.com/member.php...fo&userid=1088
View this thread: http://www.excelforum.com/showthread.php?threadid=27638

  #3   Report Post  
Posted to microsoft.public.excel.programming
No Name
 
Posts: n/a
Default Do using range vs. row iteration?

hi
Range("A1", Range("A1").Offset(10, 255)).Select
Selection.RowHeight = 25.5

in this example i just selected a range 10 rows down from
A1 and 255 collumns(all). you will have to find out how to
select your range. the above rowheight command is pretty
instantanious.
regards

-----Original Message-----
I'd like to set the height of all my rows to a certain

minimum height. At
the moment, the only thing I can make work is to iterate

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

Is there a faster way to do this using a range?

Ed


.

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 860
Default Do using range vs. row iteration?

Hi Ed,

Ed wrote:
I'd like to set the height of all my rows to a certain minimum
height. At the moment, the only thing I can make work is to iterate
through every row: For iRow = numRow To 2 Step -1
If Rows(iRow).RowHeight < 25.5 Then
Rows(iRow).RowHeight = 25.5
End If
Next iRow

Is there a faster way to do this using a range?


As others have noted, it will be much faster to set the row height on a
range than through iterating over the rows 1 by 1.

This command will set the row height to 25.5 for the entire used range of
the active Worksheet:

ActiveSheet.UsedRange.RowHeight = 35.5

--
Regards,

Jake Marx
MS MVP - Excel
www.longhead.com

[please keep replies in the newsgroup - email address unmonitored]

  #5   Report Post  
Posted to microsoft.public.excel.programming
Ed Ed is offline
external usenet poster
 
Posts: 399
Default Only set if LESS THAN . . .

Thanks for the tips. I can do that. But sometimes with Word Wrap on, the
information in the row has already made the row more than 25.5. If I make
it "only" 25.5, I will cut off text. Using the iteration, I can check to
see if the row is less than that, and enlarge it if it is; it is left alone,
though, if it's already tall enough.

Ed

"Ed" wrote in message
...
I'd like to set the height of all my rows to a certain minimum height. At
the moment, the only thing I can make work is to iterate through every

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

Is there a faster way to do this using a range?

Ed




Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Iteration Khalil[_2_] Excel Worksheet Functions 4 June 19th 09 08:21 PM
iteration Gareth Milton Excel Discussion (Misc queries) 1 March 28th 07 04:18 PM
Iteration Jan Excel Discussion (Misc queries) 1 January 10th 06 11:10 PM
Non-Contiguos Range Iteration Matthew Wieder Excel Programming 8 March 4th 04 12:54 PM
NonContiguous Range Iteration Bug? Matthew Wieder Excel Programming 5 March 3rd 04 04:58 PM


All times are GMT +1. The time now is 12:40 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"