Results 1 to 5 of 5

Thread: autofit msgbox to text length

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1

    autofit msgbox to text length

    my msgbox is too short and a line of text moves to two lines.
    • I want the line of text to be on one line.
    • All text is showing in the msgbox, just not on one line
    • the text length could change randomly


    Is there an option to 'autofit' the msgbox

    Dim answer As Integer
    Dim PullFromPPTFileName As String
    
    PullFromPPTFileName = "Figure 121. Gonorrhea - Rates by Year, Tucson Total, 2017-2021.pptx"
    
    answer = MsgBox("The current file to be uploaded is" _ 
                       & vbCrLf & _ 
                       PullFromPPTFileName _ 
                       & vbCrLf _
                       & vbCrLf & _  
                       "Would you like to upload the correct file and try again?", _ 
                      vbQuestion + _ 
                      vbYesNo + _ 
                      vbDefaultButton1)
    If answer = vbYes
           Then  MsgBox "Yes"
           Else  MsgBox "No"
    End If
    Last edited by Paul_Hossler; 08-11-2023 at 10:07 AM. Reason: Amended the tags used to wrap the supplied code

Tags for this Thread

Posting Permissions

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