close

Is it possible for a cell to automatically size itself by height to fit the
information pulled into said cell by a VLookup formula. The information in
my data table are of differing lengths. I currently have to stop working in
my spreadsheet to size the cells by height to visually see all the
information.

Could you resize all the usedrange's rowheights each time excel recalculates?

If yes, rightclick on the worksheet tab that should have this behavior. Select
view code and paste this in:

Option Explicit
Private Sub Worksheet_Calculate()
Me.UsedRange.Rows.AutoFit
End Sub

If you don't want to do all the rows, you can specify the ones you want:

Option Explicit
Private Sub Worksheet_Calculate()
Me.UsedRange.Range(quot;a5:a12quot;).EntireRow.AutoFit
End Sub

(It resizes 5:12 and leaves the rest alone.)

Mike wrote:
gt;
gt; Is it possible for a cell to automatically size itself by height to fit the
gt; information pulled into said cell by a VLookup formula. The information in
gt; my data table are of differing lengths. I currently have to stop working in
gt; my spreadsheet to size the cells by height to visually see all the
gt; information.

--

Dave Peterson

Dave, You are a genius. That was totally helpful and solved my dilema. I
thank you very much.

quot;Dave Petersonquot; wrote:

gt; Could you resize all the usedrange's rowheights each time excel recalculates?
gt;
gt; If yes, rightclick on the worksheet tab that should have this behavior. Select
gt; view code and paste this in:
gt;
gt; Option Explicit
gt; Private Sub Worksheet_Calculate()
gt; Me.UsedRange.Rows.AutoFit
gt; End Sub
gt;
gt; If you don't want to do all the rows, you can specify the ones you want:
gt;
gt; Option Explicit
gt; Private Sub Worksheet_Calculate()
gt; Me.UsedRange.Range(quot;a5:a12quot;).EntireRow.AutoFit
gt; End Sub
gt;
gt; (It resizes 5:12 and leaves the rest alone.)
gt;
gt; Mike wrote:
gt; gt;
gt; gt; Is it possible for a cell to automatically size itself by height to fit the
gt; gt; information pulled into said cell by a VLookup formula. The information in
gt; gt; my data table are of differing lengths. I currently have to stop working in
gt; gt; my spreadsheet to size the cells by height to visually see all the
gt; gt; information.
gt;
gt; --
gt;
gt; Dave Peterson
gt;

全站熱搜
創作者介紹
創作者 software 的頭像
software

software

software 發表在 痞客邦 留言(0) 人氣()