MsgBox when the cell is empty

  • Thread starter Thread starter Mia
  • Start date Start date
M

Mia

Hi,

I want a msgBox when a cell i empty,
I can´t get the cod to work, do anyone
know how to do this?

My code are

Dim Period As Date
Period = ActiveSheet.Range("b3")

If Period="" Then
MsgBox "Du har glömt att välja sorteringsperiod", vbCritical

Exit Sub
 
Try

Dim Period As Date
If ActiveSheet.Range("b3") = "" Then
MsgBox "Du har glömt att välja sorteringsperiod", vbCritical
Exit Sub
Else
Period = ActiveSheet.Range("b3")
End If
 
Back
Top