![]() |
MsgBox when the cell is empty
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 -- Best regards Mia |
MsgBox when the cell is empty
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 -- Jacob "Mia" wrote: 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 -- Best regards Mia |
MsgBox when the cell is empty
Thank you so much!!!
-- Best regards Mia "Jacob Skaria" skrev: 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 -- Jacob "Mia" wrote: 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 -- Best regards Mia |
MsgBox when the cell is empty
You need to put the code in the activsheet code module or in the sheet code module for the sheet you are working on. Mia;616610 Wrote: 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 -- Best regards Mia -- Simon Lloyd Regards, Simon Lloyd 'Microsoft Office Help' (http://www.thecodecage.com) ------------------------------------------------------------------------ Simon Lloyd's Profile: 1 View this thread: http://www.thecodecage.com/forumz/sh...d.php?t=171308 Microsoft Office Help |
All times are GMT +1. The time now is 12:36 PM. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com