Thread: Msg Box
View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Norman Jones[_2_] Norman Jones[_2_] is offline
external usenet poster
 
Posts: 421
Default Msg Box

Hi Alexandre,

Try something like:

'============
Option Explicit

Public Sub Tester001()
Dim WB As Workbook
Dim SH As Worksheet
Dim Rng As Range

Set WB = Workbooks("Test.xls") '<<==== CHANGE
Set SH = WB.Sheets("Sheet1") '<<==== CHANGE
Set Rng = SH.Range("A1")

If Rng.Value < Date Then
MsgBox Prompt:="Date is different to today. " _
& "Do you wish to continue?", _
Buttons:=vbOKCancel, _
Title:="Date Check"
End If

End Sub
'<<============



---
Regards,
Norman


"Alexandre Chauar" wrote in message
...
Hi,

I need to create a very simple sub:

In cell A1 I input a date;
If A1 is different from today, then an Msg Box says "Date is different of
today. Do you wish to continue?
Buttons Ok and Cancel

Can anybody help?

Best regards,
Alexandre