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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top