I have a vba code which segregates data into multiple sheets (did that with help from Mr.Excel forum) now i have to check the data so my Range ("H2:H100") in sheet named "Data Sheet" will give two Values, either "Success" or "Error". If any cell from H2:H100 gives the result "Error". I want a MsgBox "Kindly Check Errors and Try again" and then exit the macro. If every cell reflects success it can proceed to the second part of splitting.
I tried the following
What Happens here is it checks each individual cell and and does the same
if H3 has error it skips H3 and goes to H4
and runs the code for H4 if it is Success
P.S: I am totally zero regarding VBA i just got to understand few from the codes i have seen
Thanks in advance
I tried the following
VBA Code:
Dim Error as Range
Dim Cell as Range
Set Error = Range("H2:H100)
For Each Cell in Range
if cell.value = "Error"Then
MsgBox "Kindly Check Errors"
Else
(The Other Code)
End IF
Next Cell
End Sub
What Happens here is it checks each individual cell and and does the same
if H3 has error it skips H3 and goes to H4
and runs the code for H4 if it is Success
P.S: I am totally zero regarding VBA i just got to understand few from the codes i have seen
Thanks in advance
Last edited by a moderator: