I running a report that is dymaic and the number of rows change and I need to make mandatory cells. Now I may just be tired but I cant seem to get it to see there is something in the cell and it always comes up with blank when it finds a line with a 1. plus can this work fork more then 2 cells code bellow. range is only 3 row long for testing
Sub manditory1()
For Each i In Range("S47:S50")
If i = 1 Then
For Each cell In Sheets("Multi").Range("D" & ActiveCell.Row, "F" & ActiveCell.Row)
If IsEmpty(ActiveCell) Then
break = x
Cancel = True
Exit For
End If
Next cell
End If
Next i
If break = x Then
MsgBox "Mandatory field not completed"
Else
End If
End Sub
Sub manditory1()
For Each i In Range("S47:S50")
If i = 1 Then
For Each cell In Sheets("Multi").Range("D" & ActiveCell.Row, "F" & ActiveCell.Row)
If IsEmpty(ActiveCell) Then
break = x
Cancel = True
Exit For
End If
Next cell
End If
Next i
If break = x Then
MsgBox "Mandatory field not completed"
Else
End If
End Sub