Prev: Comparing the data in between two worksheets and pasting the data in next worksh
Next: Where do I paste in the following Access SQL code into my routine?
From: Mia on 19 Jan 2010 07:51 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
From: Jacob Skaria on 19 Jan 2010 07:58 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
From: Mia on 19 Jan 2010 08:02 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
From: Simon Lloyd on 19 Jan 2010 08:07
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/showthread.php?t=171308 [url="http://www.thecodecage.com"]Microsoft Office Help[/url] |