+ Reply to Thread
Results 1 to 5 of 5

Text Box

  1. #1
    Registered User
    Join Date
    05-30-2006
    Posts
    5

    Text Box

    Can you make a text box resize automatically when you type in more info than can fit? What about using a large cell instead of a text box? Can you make it resize automatically to wrap and fit it all into view?
    Thanks,
    Brad

  2. #2
    Daniel CHEN
    Guest

    Re: Text Box

    For text box:

    In the format-alignment -> check the box for "automatic size"


    --
    Best regards,
    ---
    Yongjun CHEN
    =================================
    XLDataSoft - Data Analysis Expert, Excel/VBA Specialist
    - - - - www.XLDataSoft.com - - - -
    Free Excel-Based Data Processing Tool is Available for Download
    Free Excel / VBA Training Materials is Available for Download
    =================================
    "bparker" <[email protected]> wrote in
    message news:[email protected]...
    >
    > Can you make a text box resize automatically when you type in more info
    > than can fit? What about using a large cell instead of a text box?
    > Can you make it resize automatically to wrap and fit it all into view?
    > Thanks,
    > Brad
    >
    >
    > --
    > bparker
    > ------------------------------------------------------------------------
    > bparker's Profile:
    > http://www.excelforum.com/member.php...o&userid=34940
    > View this thread: http://www.excelforum.com/showthread...hreadid=546820
    >




  3. #3
    CWillis
    Guest

    RE: Text Box

    Brad,

    If the automatic size button was the answer to your question, ignore the
    rest of this.

    I worked all day on something similar. (It shouldn't have taken all day,
    but I'm just beginning.) The following code resizes what is typed into a
    text box, pastes it in another cell, and then goes back and reformats the
    original text box it came from. This is probably more than you are looking
    for, but reworking and naming some of the code may help you out.

    Dim variable

    Sub ProdResSummaryTextBox()

    ''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
    'This fills in and formats the summary text box on the Prod. Res. tab'
    'and copies and formats it to the Summ. tab. '
    ''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''

    'Finding out the appropriate dimensions for the text box
    Sheets("Prod. Res.").Activate
    Sheets("Prod. Res.").Shapes("ProdResTextBox1").Select
    Selection.Copy
    With Selection
    .AutoSize = True
    variable = .Width
    End With


    ''''''''''''''''''''''''''''''''''''''''''''''''
    'Changing the dimensions of the Summ text box '
    ''''''''''''''''''''''''''''''''''''''''''''''''
    Sheets("Summ").Select
    ''''''''Testing'''''''''''
    'If ActiveSheet.Shapes("SummTextBox1").Value Then
    'ActiveSheet.Shapes("SummTextBox1").Select
    'Selection.Delete
    'End If
    ''''''''''''''''''''''''''''''
    ActiveSheet.Range("A46").Select
    ActiveSheet.Paste

    With Selection
    .Name = "SummTextBox1"
    .ShapeRange.LockAspectRatio = msoFalse
    .ShapeRange.Height = (variable / 650) * 15 + 15
    .ShapeRange.Width = 650#
    End With


    '''''''''''''''''''''''''''''''''''''''''''''''''
    'Changing the dimension on the original text box'
    '''''''''''''''''''''''''''''''''''''''''''''''''
    Sheets("Prod. Res.").Activate
    Sheets("Prod. Res.").Shapes("ProdResTextBox1").Select

    With Selection
    .AutoSize = False
    .ShapeRange.LockAspectRatio = msoFalse
    .ShapeRange.Height = (variable / 650) * 15 + 15
    .ShapeRange.Width = 650#
    End With

    End Sub


    "bparker" wrote:

    >
    > Can you make a text box resize automatically when you type in more info
    > than can fit? What about using a large cell instead of a text box?
    > Can you make it resize automatically to wrap and fit it all into view?
    > Thanks,
    > Brad
    >
    >
    > --
    > bparker
    > ------------------------------------------------------------------------
    > bparker's Profile: http://www.excelforum.com/member.php...o&userid=34940
    > View this thread: http://www.excelforum.com/showthread...hreadid=546820
    >
    >


  4. #4
    Registered User
    Join Date
    05-30-2006
    Posts
    5

    Text box

    Thanks for your help! The automatic size thing is nice, but it makes it all one very long line! Can I set a maximum horizontal size so that it will automatically size vertically, adding lines where more are needed???
    Brad

  5. #5
    CWillis
    Guest

    Re: Text Box

    Sorry, not that I could figure out. In the code, I just set the horizontal
    distance I wanted. Then, I found the width of the one very long line. From
    there, I calculated the approximate verticle size. So no, I don't know how
    to do it automatically, but the code I displayed does what I described above.

    "bparker" wrote:

    >
    > Thanks for your help! The automatic size thing is nice, but it makes it
    > all one very long line! Can I set a maximum horizontal size so that it
    > will automatically size vertically, adding lines where more are
    > needed???
    > Brad
    >
    >
    > --
    > bparker
    > ------------------------------------------------------------------------
    > bparker's Profile: http://www.excelforum.com/member.php...o&userid=34940
    > View this thread: http://www.excelforum.com/showthread...hreadid=546820
    >
    >


+ 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