Results 1 to 3 of 3

Thread: Active X TextBox with fixed width, but dynamic height

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #2
    Fuhrer, Vierte Reich DocAElstein's Avatar
    Join Date
    Aug 2014
    Posts
    10,457
    Rep Power
    10
    Hi
    I may not be able to help too much, since I have no experience with Active X text boxes.

    I tried for the first time ever to get what you may be asking for . This is how it went. ( Using Excel 2007 )


    _1) I need the Developer ribbon ( You may already have this)
    ExcelOptions.JPG : https://imgur.com/p8gVo1y
    Show Developer tab in Ribbon.JPG : https://imgur.com/JcB0DCu
    Developer tab OK.JPG : https://imgur.com/W7y84A5

    _2) Insert the text box
    Developer Insert Text Box.JPG : https://imgur.com/qkcBkib
    Finally , move cross cursor to top left of where you want the text box, and then hold left mouse and drag window to size you want, or just click once to add the text box, ( https://support.microsoft.com/en-us/...a-001f3ecd6cd6 )

    _3) Make sure you are still in Design mode
    Still in Design Mode.JPG : https://imgur.com/qT3EVGS

    _4) right click in Text Boxwindow and select View Code
    Text Box View Code.JPG : https://imgur.com/l89FgZo

    _5) In the properties window you need to make 3 things True ( or = 1 )
    Text Box Autosize True.JPG : : https://imgur.com/vVNuefX
    Text Box Multiline True.JPG : https://imgur.com/1JrMRSX
    Enter Field Behavior True.JPG : https://imgur.com/wnupBCX

    _6) Give the Height and Width Properties that you want
    Text Box Width Height.JPG : https://imgur.com/Wn0xVQ2

    _7) Add this coding:
    Code:
    Private Sub TextBox1_Change()
        If TextBox1.Height < 139 Then Let TextBox1.Height = 139.8
     Let TextBox1.Width = 368.25
    End Sub
    _8) De select the Design mode by clicking once on the ribbon Design Mode icon , until it is no longer highlighted
    De Select Design Mode.JPG : https://imgur.com/DKR4Ky4
    De Selected Design Mode.JPG : https://imgur.com/UdvRsFk





    If that does not help, then I may not be able to help further, as I this was my first attempt at anything to do with a Text Box

    Alan



    Ref https://www.ozgrid.com/forum/index.p...eight-to-text/



    The Text Box in this file, appears to do something like you are asking for:
    ‘Book1.xlsm’ : https://app.box.com/s/2zw5tvwsz2daru9wboks1cgfygb4x9m2
    Last edited by DocAElstein; 06-04-2020 at 05:42 PM.
    ….If you are my competitor, I will try all I can to beat you. But if I do, I will not belittle you. I will Salute you, because without you, I am nothing.
    If you are my enemy, we will try to kick the fucking shit out of you…..
    Winston Churchill, 1939
    Save your Forum..._
    KILL A MODERATOR!!

Similar Threads

  1. Replies: 2
    Last Post: 08-27-2015, 05:34 PM
  2. VBA Code To Autofit The Row Height Of Merged Cells
    By David Michael in forum Excel Help
    Replies: 6
    Last Post: 03-07-2014, 01:16 AM
  3. Replies: 1
    Last Post: 02-03-2014, 06:17 PM
  4. How to make Dynamic range (width) with OFFset function
    By Rajesh Kr Joshi in forum Excel Help
    Replies: 12
    Last Post: 12-01-2012, 11:03 PM
  5. Replies: 2
    Last Post: 11-08-2011, 08:52 AM

Posting Permissions

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