+ Reply to Thread
Results 1 to 2 of 2

Looping Data = TRUE to a MsgBox

  1. #1
    JMay
    Guest

    Looping Data = TRUE to a MsgBox

    Could someone provide an example of Looping thru a range of 20 records
    and where say 5 records = True, and 15 = False; On completion a Msgbox
    would Pop-up
    stacking the results as follows:

    TrueCell1.Address TrueCell1.Value << ... & Chr (10) &... is involved
    here (I think).
    TrueCell2.Address TrueCell2.Value
    TrueCell3.Address TrueCell3.Value
    TrueCell4.Address TrueCell4.Value
    TrueCell5.Address TrueCell5.Value

    Sorry not to have all required data, but any
    help would be appreciated.

    TIA,



  2. #2
    Tom Ogilvy
    Guest

    Re: Looping Data = TRUE to a MsgBox

    sStrTrue = " - True - " & vbNewLine
    sStrFalse = " - False - " & vbNewLine
    for each cell in Range("A1:A20")
    if cell.Value then
    sStrTrue = sStrTrue & cell.Address & " " & cell.Value & vbNewLine
    else
    sStrFalse = sStrFalse & cell.Address & " " & cell.Value & vbNewline
    End if
    Next
    msgbox sStrTrue & sStrFalse

    if you want them spaced exactly in columns, that would take a bit more work.

    --
    Regards
    Tom Ogilvy

    "JMay" <[email protected]> wrote in message
    news:X_TId.34804$jn.25212@lakeread06...
    > Could someone provide an example of Looping thru a range of 20 records
    > and where say 5 records = True, and 15 = False; On completion a Msgbox
    > would Pop-up
    > stacking the results as follows:
    >
    > TrueCell1.Address TrueCell1.Value << ... & Chr (10) &... is involved
    > here (I think).
    > TrueCell2.Address TrueCell2.Value
    > TrueCell3.Address TrueCell3.Value
    > TrueCell4.Address TrueCell4.Value
    > TrueCell5.Address TrueCell5.Value
    >
    > Sorry not to have all required data, but any
    > help would be appreciated.
    >
    > TIA,
    >
    >




+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1