Results 1 to 2 of 2

Thread: Macro to adjust a textbox to the size of the text
Thanks Thanks: 0 Likes Likes: 0

  1. #1
    Board Regular
    Join Date
    Feb 2014
    Posts
    2,318
    Post Thanks / Like
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)

    Default Macro to adjust a textbox to the size of the text

    Hi Everyone,

    I've been playing around with activex text boxes and have found I can adjust the height as I type.
    so what I would like is a bit of code that can adjust the textbox to one line bigger (or the size of the text i'm tying in

    I have this bit of code that will resize the text box so I need someone to show me how to make it dynamic if possibleplease

    this is what I have it triggers everytime you type into the textbox.

    Code:
    Private Sub TextBox1_Change()
        ActiveSheet.Shapes("TextBox1").Height = 300
    End Sub
    please help if you can thanks

    Tony

  2. #2
    Board Regular Akuini's Avatar
    Join Date
    Feb 2016
    Location
    Indonesia
    Posts
    2,062
    Post Thanks / Like
    Mentioned
    36 Post(s)
    Tagged
    4 Thread(s)

    Default Re: Macro to adjust a textbox to the size of the text

    Maybe something like this:

    Code:
    Private Sub TextBox1_Change()
       TextBox1.Height = TextBox1.Height + 20
    End Sub

Some videos you may like

User Tag List

Tags for this Thread

Like this thread? Share it with others

Like this thread? Share it with others

Posting Permissions

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