+ Reply to Thread
Results 1 to 3 of 3

Cell sizing in a Vlookup formula to fit information.

  1. #1
    Mike
    Guest

    Cell sizing in a Vlookup formula to fit information.

    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.

  2. #2
    Dave Peterson
    Guest

    Re: Cell sizing in a Vlookup formula to fit 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("a5:a12").EntireRow.AutoFit
    End Sub

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

    Mike wrote:
    >
    > 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.


    --

    Dave Peterson

  3. #3
    Mike
    Guest

    Re: Cell sizing in a Vlookup formula to fit information.

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

    "Dave Peterson" wrote:

    > 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("a5:a12").EntireRow.AutoFit
    > End Sub
    >
    > (It resizes 5:12 and leaves the rest alone.)
    >
    > Mike wrote:
    > >
    > > 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.

    >
    > --
    >
    > Dave Peterson
    >


+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1