VBA: function to display results

Solved
nchristedem Posted messages 24 Status Member -  
nchristedem Posted messages 24 Status Member -
Hello,
I am a beginner in VBA. I am looking for a function that allows me to display multiple results in a dialog box. MsgBox only allows me to display a single value, while I would like to display several at once (so I don't have to click OK multiple times). Thank you.
Configuration: Windows 2000 Firefox 3.0.10

4 answers

  1. lami20j Posted messages 21506 Registration date   Status Moderator, Security Contributor Last intervention   3 571
     
    Hello,

    MsgBox allows me to display a single

    Well, no, msgbox allows you to display as many values as you want
    msgbox "Here is value 1: " & val1 & vbcrlf & "Here is value 2: " & val2 & vbcrlf & "Here is value 3: " & val3

    On the other hand, what is i
    --
    106485010510997108
    5
  2. lami20j Posted messages 21506 Registration date   Status Moderator, Security Contributor Last intervention   3 571
     
    Re,

    Maybe you should show what code you are using

    Here is an example
     Sub example_msgbox() Dim val1 as Integer, val2 as Integer, val3 as Integer val1 = 10 val2 = 20 val3 = 30 MsgBox "Here is value 1: " & val1 & vbcrlf & "Here is value 2: " & val2 & vbcrlf & "Here is value 3: " & val3 End Sub

    --
    106485010510997108
    4
  3. nchristedem Posted messages 24 Status Member 4
     
    I tried your code, but it's exactly the text that it displays to me. I don't have the variable values (results).
    1
  4. nchristedem Posted messages 24 Status Member 4
     
    Thank you very much, it works very, very well. I didn't quite understand your code in the first message. Hi.
    1