Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
Mia Mia is offline
external usenet poster
 
Posts: 101
Default 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
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 8,520
Default 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

  #3   Report Post  
Posted to microsoft.public.excel.programming
Mia Mia is offline
external usenet poster
 
Posts: 101
Default 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

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default 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

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
find last non empty cell in a column and display value in msgbox SeanC UK[_2_] Excel Programming 1 February 2nd 09 12:12 PM
find empty cells in a column then append row that empty cell is in vbnewbie Excel Programming 9 January 29th 09 09:27 AM
Macro display Msgbox when cells are empty jackie Excel Discussion (Misc queries) 2 May 30th 07 05:48 PM
why a reference to an empty cell is not considered empty Nicoscot Excel Discussion (Misc queries) 10 March 10th 06 05:36 AM
Finding next empty empty cell in a range of columns UncleBun Excel Programming 1 January 13th 06 11:22 PM


All times are GMT +1. The time now is 06:40 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"