none
Unable to scroll text in texbox in excel RRS feed

  • Question

  • Hi, 

    I have created one macro file in excel and there i have used scrollbar inside text box to display long text.. But when I reopen the file and click on scrollbar , the text got shrinked (font size become small) instead of scrolling up and down in a textbox. Also, I have set all the necessary properties for text box but it is not working. Please suggest me the solution as soon as possible.

    Wednesday, October 24, 2018 7:31 PM

All replies

  • Hi Richa,

    If you want to use VBA code to scroll text in a text box, you can insert a UserForm and then insert a text box. Please use the following code:

    Private Sub UserForm_Initialize()
      With Me.TextBox1
        .MultiLine = True
        .ScrollBars = fmScrollBarsVertical
          
      End With
    End Sub

    Hopefully it helps you.

    Best Regards,

    Lina


    MSDN Community Support Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread.


    • Edited by Lina-MSFT Thursday, October 25, 2018 2:55 AM
    Thursday, October 25, 2018 2:53 AM
  • Hi Richa,

    Thanks for your asking. Please remember to mark the replies as answers if they helped and please help us close the thread.

     

    Thank you for understanding. If you have any question, or update, please feel free to let us know.

     

    I wish you a happy life!

     

    Best Regards,

     

    Lina


    MSDN Community Support Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread.

    Friday, October 26, 2018 9:18 AM