View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
p45cal[_116_] p45cal[_116_] is offline
external usenet poster
 
Posts: 1
Default Can rows / columns be resized based on the value of cells?


Put your two values in A1 and A2 then run this
macro:Sub Blah()
Columns("C:C").ColumnWidth = Range("A1").Value
Rows("3:3").RowHeight = Range("A2").Value
End Sub
or put the following in the sheet's code
module:Private Sub Worksheet_Change(ByVal Target As
Range)
If Target.Address = Range("A1").Address Then
Columns("C:C").ColumnWidth = Range("A1").Value
End If
If Target.Address = Range("A2").Address Then
Rows("3:3").RowHeight = Range("A2").Value
End If
End Sub
and watch the column width and row height change as you
enter different values in the two cells.


--
p45cal

*p45cal*
------------------------------------------------------------------------
p45cal's Profile: http://www.thecodecage.com/forumz/member.php?userid=558
View this thread: http://www.thecodecage.com/forumz/sh...d.php?t=135028