Hi,
I would like to change the following code so instead of the code looking for B7,C7,D7,F7 cells I would like it to look for the first empty cell in the same columns.
My form is locked so only the active row can be selected and the entries will always be on the same row. So the entries cannot be staggered.
Here is my code:
Any help would be much appreciated.
Thanks
Dan
I would like to change the following code so instead of the code looking for B7,C7,D7,F7 cells I would like it to look for the first empty cell in the same columns.
My form is locked so only the active row can be selected and the entries will always be on the same row. So the entries cannot be staggered.
Here is my code:
Code:
Sub MyCellCheck()
Dim cell As Range
Dim str As String
Dim bIsEmpty As Boolean
For Each cell In Range("B7,C7,D7,F7")
If IsEmpty(cell) = True Then
str = str & Cells(6, cell.Column).Value & vbCrLf
cell.Interior.Color = RGB(255, 0, 0)
bIsEmpty = True
End If
Next cell
If bIsEmpty = True Then
MsgBox "Please complete the following highlighted cells: " & vbNewLine & vbNewLine & str
For Each cell In Range("B7,C7,D7,F7")
cell.Interior.Color = RGB(255, 255, 255)
Next cell
End If
End Sub
Any help would be much appreciated.
Thanks
Dan