For Each i In Range("S47:S50")
If i = 1 Then
For Each cell In Sheets("sheet1").Range(D?:G?)
.
.
.
Next cell
End If
Next i
Sub manditory2()
For Each i In Range("S47:S82")
If i = 1 Then
For Each cell In Sheets("sheet1").Range("D" & i)
If IsEmpty("D" & i) Then
MsgBox "Mandatory field not filled"
Application.Goto cell
Cancel = True
Exit For
End If
Next cell
End If
Next i
end sub
RowNumber = 8
For i = 4 To 7 ' the column numbers for Columns D, E, F and G
If Cells(RowNumber, i).Value = "" Then
MsgBox "Mandatory field not filled"
Application.Goto Cells(RowNumber, i)
Cancel = True
Exit For
End If
Next