Hey all!
I'm using a MSG Box to display values from a range of cells. The below code is working, but the range actually needs to be dynamic.
There is a formula in H2-H400 doing a lookup. A value (That I want to display in the MsgBox) will only appear in this range if the user updates the workbook. If no changes are made, the values in column H will have a zero in it.
Ideally, I'd like it to identify what cells in the range have a zero in them, and omit them from the values printed in the MsgBox.
As another option, I wrote a formula in i1 & J1 (on sheet "Verify") that automatically update to correct range - we could do an indirect to those cells.
Been struggling on getting either of these options working and wanted to reach out for a helping hand.
Thanks all!
I'm using a MSG Box to display values from a range of cells. The below code is working, but the range actually needs to be dynamic.
There is a formula in H2-H400 doing a lookup. A value (That I want to display in the MsgBox) will only appear in this range if the user updates the workbook. If no changes are made, the values in column H will have a zero in it.
Ideally, I'd like it to identify what cells in the range have a zero in them, and omit them from the values printed in the MsgBox.
As another option, I wrote a formula in i1 & J1 (on sheet "Verify") that automatically update to correct range - we could do an indirect to those cells.
Been struggling on getting either of these options working and wanted to reach out for a helping hand.
Thanks all!
VBA Code:
Sub VER_Bulk()
Set Rng = Sheets("Verify").Range("H1:H7")
For Row = 2 To Rng.Rows.Count
For col = 1 To Rng.Columns.Count
Values = Values & Rng.Cells(Row, col).Value _
& vbTab & vbTab
Next col
Values = Values & vbNewLine
Next Row
MsgBox "Updates have been made to the following zones: " _
& vbLf & vbLf & Values
End Sub
Last edited: