View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Tom Ogilvy Tom Ogilvy is offline
external usenet poster
 
Posts: 27,285
Default 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" 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,