Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Is there a way that I can control a row's height with programming? (or cell contents)

I'm trying to control the height of a row determined by the contents o
a cell...

I can't seem to find a function or command that is available to me t
allow this.

Alternatively, is there a way that I can 'hide' or 'unhide' a row base
on a cell's contents?

Best to you!

Larry Seye

--
Message posted from http://www.ExcelForum.com

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 25
Default Is there a way that I can control a row's height with programming? (or cell contents)

Larry,

Some ideas,

To change row height:
'*****
Sub test45()
With ActiveSheet.Rows(3)
If .Cells(1) = "Q2" Then
.RowHeight = 25
Else
.RowHeight = 12.75
End If
End With
End Sub
'*****

To hide the row:
'*****
Sub test45B()
With ActiveSheet.Rows(3)
If .Cells(1) = "Q2" Then
.Hidden = True
End If
End With
End Sub
'*****

HTH
Anders Silven

"lseyer " skrev i meddelandet
...
I'm trying to control the height of a row determined by the contents of
a cell...

I can't seem to find a function or command that is available to me to
allow this.

Alternatively, is there a way that I can 'hide' or 'unhide' a row based
on a cell's contents?

Best to you!

Larry Seyer


---
Message posted from http://www.ExcelForum.com/


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Is there a way that I can control a row's height with programming? (or cell contents)

Thanks for your help!

Here is the code that worked for me...

Private Sub Workbook_SheetCalculate(ByVal Sh As Object)

For rwindex = 1 To 26
If Worksheets("Items").Cells(rwindex, 1).Value = "0" Then
Worksheets("Items").Rows(rwindex).Hidden = True
Else
Worksheets("Items").Rows(rwindex).Hidden = False
End If
Next rwindex

End Su

--
Message posted from http://www.ExcelForum.com

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 25
Default Is there a way that I can control a row's height with programming? (or cell contents)

And to save some typing,

'*****
Private Sub Workbook_SheetCalculate(ByVal Sh As Object)
Dim rwindex
With Worksheets("Items")
For rwindex = 1 To 26
If .Cells(rwindex, 1).Value = "0" Then
.Rows(rwindex).Hidden = True
Else
.Rows(rwindex).Hidden = False
End If
Next rwindex
End With
End Sub
'*****

Regards,
Anders Silven

"lseyer " skrev i meddelandet
...
Thanks for your help!

Here is the code that worked for me...

Private Sub Workbook_SheetCalculate(ByVal Sh As Object)

For rwindex = 1 To 26
If Worksheets("Items").Cells(rwindex, 1).Value = "0" Then
Worksheets("Items").Rows(rwindex).Hidden = True
Else
Worksheets("Items").Rows(rwindex).Hidden = False
End If
Next rwindex

End Sub


---
Message posted from http://www.ExcelForum.com/


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
autofit cell height and width to match bitmap contents gurubox Excel Worksheet Functions 0 December 18th 08 07:06 PM
Turning a row's contents into a column of entries Musawwir Spiegel New Users to Excel 2 February 20th 08 10:12 PM
How to control row height and text wrap in non-merged cell ??? akm Excel Discussion (Misc queries) 2 November 16th 07 02:01 AM
linked cell contents not autofitting row height joeeng Excel Discussion (Misc queries) 5 August 2nd 05 07:58 PM
How do I make Excel automatically adjust a row's height once I in. sueuy Excel Worksheet Functions 1 December 2nd 04 05:35 PM


All times are GMT +1. The time now is 09:58 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"