VBA Excel: Getting result for multiple cells -
i trying result of different cells based on preset if
statement receiving result in multiple message boxes, , result cells being calculated based on first statement check up. how can receive results in single msgbox
and allow function check every single cell in range?
dim rcell range each rcell in vou_summary.range("i5:i16") if 0 < rcell <= 2.5 msgbox rcell.cells.offset(0, -3).value & " critical", vbokonly, "notice!" elseif 2.5 < rcell <= 4 msgbox rcell.cells.offset(0, -3).value & " requires pr placement", vbokonly, "notice!" elseif rcell >= 7 msgbox rcell.cells.offset(0, -3).value & " oversupplied", vbokonly, "notice!" else end if next
you can create string variable first. don't throw msgbox save results variable. past end if
statement show msgbox , pass string variable content.
better, can use string builder make work 1000 times faster default vba concatenation ;)
Comments
Post a Comment