Results 1 to 4 of 4
  1. #1
    Bronze Lounger
    Join Date
    Sep 2007
    Posts
    1,203
    Thanks
    0
    Thanked 0 Times in 0 Posts

    IF inside a msgbox (2002)

    Is it possible to use IF statements in a messagebox? I am using the attached code to generate an “end of process messagebox” as shown in the next post. I only want to generate each of the Corp……… lines where the data is greater than zero. Eg: If Worksheets("10").Range("D9") = 0, then omit that row from the messagebox.

    Would that be possible?
    Attached Files Attached Files

  2. #2
    Bronze Lounger
    Join Date
    Sep 2007
    Posts
    1,203
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: IF inside a msgbox (2002)

    <P ID="nt"><font size=-1>(No Text)</font>
    Attached Images Attached Images

  3. #3
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: IF inside a msgbox (2002)

    First assemble the string to be displayed, e.g.

    Dim strMessage As String
    If Worksheets("10").Range("D9") > 0 Then
    strMessage = strMessage & ...
    End If
    If ... Then
    ...
    End If
    ...
    MsgBox strMessage

  4. #4
    Bronze Lounger
    Join Date
    Sep 2007
    Posts
    1,203
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: IF inside a msgbox (2002)

    <img src=/S/cheers.gif border=0 alt=cheers width=30 height=16>

Posting Permissions

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