Consulting

Results 1 to 3 of 3

Thread: Adding a Scroll Option to The Text Boc Functionality

  1. #1

    Adding a Scroll Option to The Text Boc Functionality

    Hi Excel Community

    I have attached a questionnaire template and would like to modify the VBA slightly to show the following:

    At the moment if you click on the create questionnaire button, an Excel template is created on your desktop.

    However, when you choose the text box option, I can easily modify the length and width.

    What I would like is on the text box option is to have a scroll bar because at the moment when you start typing and after it reaches the text box length you start losing visibility.

    I would like if I choose a particular text box size, once it reaches the particular length, it then goes onto the second line.

    I hope I am clear.

    Is this possible community?

    Appreciate any assistance.

    Thanks
    Attached Files Attached Files

  2. #2
    VBAX Expert Leith Ross's Avatar
    Joined
    Oct 2012
    Location
    San Francisco, California
    Posts
    552
    Location
    Hello Forex-Forex,

    I made a change to the Select Case statement in the intLoop of the Sub evtCreateQuestionnaire. This adds several properties to the text box so it will function the way you want.

            Select Case wksControl.Cells(intLoop, intColType).Value
                Case "Ques"
                    Set ole = wksQuestionnaire.OLEObjects.Add("Forms.Label.1")
                    intQues = intQues + 1
                    Application.StatusBar = "Ques " & intQues & "..."
                Case "Radio"
                    Set ole = wksQuestionnaire.OLEObjects.Add("Forms.OptionButton.1")
                    ole.Object.GroupName = "QGrp" & CStr(intQues)
                Case "Check"
                    Set ole = wksQuestionnaire.OLEObjects.Add("Forms.CheckBox.1")
                    ole.Object.GroupName = "QGrp" & CStr(intQues)
                Case "Text"
                    Set ole = wksQuestionnaire.OLEObjects.Add("Forms.TextBox.1")
                    With ole.Object
                        .EnterKeyBehavior = True
                        .MultiLine = True
                        .ScrollBars = fmScrollBarsVertical
                        .WordWrap = True
                    End With
                Case "Spin"
                    Set ole = wksQuestionnaire.OLEObjects.Add("Forms.SpinButton.1")
            End Select
    Sincerely,
    Leith Ross

    "1N73LL1G3NC3 15 7H3 4B1L17Y 70 4D4P7 70 CH4NG3 - 573PH3N H4WK1NG"

  3. #3
    Many thanks Leith for your suggestion.

    Most grateful

Posting Permissions

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