I’m using Vba and want to be able to put the cell the for loop is in into a msgbox.
This is my code:
For Each Cell In Range("C5:C11")
If Cell.Value = 0 Then
MsgBox "Please input a number for cell " & Cell & " that isn't 0."
End If
I’m not sure exactly what to put to get the code to output the cell the for loop is currently on in the msgbox.
>Solution :
you may be after this:
For Each Cell In Range("C5:C11")
If Cell.Value = 0 Then
MsgBox "Please input a number for cell " & Cell.Address & " that isn't 0."
End If
Next