Bishma1982
06-27-2016, 08:08 AM
Can someone please help? I am trying to detect value in a range of cells from the user input and handle it accordingly by this piece of code.. But the it keeps going into the 'Else' part and pops up MsgBox "Sheet is ready to be submitted".. all the time!
Sub RangeDetectEntry()
Dim DataEntry As Range
Set DataEntry = Range("B1:B3")
If DataEntry Is Nothing Then
MsgBox "Enter value"
Else
MsgBox "Sheet is ready to be submitted"
End If
End Sub
I modified the code just a bit but it keeps going into the Else part of the If loop ...
Sub RangeDetectEntry()
Dim DataEntry As Range, cell As Range
Set DataEntry = Range("B1:B3")
For Each cell In DataEntry
If cell Is Nothing Then
MsgBox "Enter value"
Else
MsgBox "Sheet is ready to be submitted"
End If
Next cell
End Sub
Sub RangeDetectEntry()
Dim DataEntry As Range
Set DataEntry = Range("B1:B3")
If DataEntry Is Nothing Then
MsgBox "Enter value"
Else
MsgBox "Sheet is ready to be submitted"
End If
End Sub
I modified the code just a bit but it keeps going into the Else part of the If loop ...
Sub RangeDetectEntry()
Dim DataEntry As Range, cell As Range
Set DataEntry = Range("B1:B3")
For Each cell In DataEntry
If cell Is Nothing Then
MsgBox "Enter value"
Else
MsgBox "Sheet is ready to be submitted"
End If
Next cell
End Sub