Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 74
Default Can rows / columns be resized based on the value of cells?

I would like columns and rows to adjust according to the values I
enter cells. For example, if A1=12, then I want column C to be
widened to a width of 12. If A2=15, then row 3 should heighten to a
height of 15. Is this possible? Thanks for your help.

Michael
  #2   Report Post  
Posted to microsoft.public.excel.programming
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

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 74
Default Can rows / columns be resized based on the value of cells?

Thanks. I'll be giving it a try shortly.

Michael
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
Can you protect a worksheet from having the columns resized,not ro Meenie Excel Worksheet Functions 3 March 28th 07 04:48 PM
Is there a way to hide worksheets and/or rows/columns based on information enter into a particular cell of range of cells? Marc New Users to Excel 1 March 10th 06 05:10 PM
rows and columns won't stay resized vulcan88 Excel Worksheet Functions 0 March 15th 05 11:11 PM
columns and rows on my worksheet will not stay resized vulcan88 Excel Worksheet Functions 0 March 15th 05 11:07 PM
Charts should not be resized when deleting rows/columns. BobM Charts and Charting in Excel 1 February 11th 05 07:39 AM


All times are GMT +1. The time now is 01:57 AM.

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"