Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 59
Default Message box date format macro help

Sub proving()
Worksheets("Proving Equipment").Visible = True
Sheets("Proving Equipment").Select
If (n62 + 31) < o62 Then
MsgBox ("Proving Equipment Expires Within 1 Month"),
vbInformation, "Proving Kit Check"
Else
'MsgBox ("No Probs"), vbInformation, "Proving Kit Check"
End If
End Sub

I have date formatted n62 and 062, and in the cells I have 16/05/09
and 16/06/09 but when I pause the macro mid stream and hover over the
n62 and o62 it says =empty.

Needless to say it doesent work unless I swap the < sign around.

It always displays the first msg box unless i swap the < then it
displays the other message box. Changing the dates doesent trigger the
change.

I want to allow 31 days before the first msg box pops up.

TIA

Aaron.
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 3,942
Default Message box date format macro help

hi
this line..
If (n62 + 31) < o62 Then
i'm not sure if VB is reading these as cell addess much less values in the
celll address ie syntax problem.
try this instead...
If [O62] - [N62] < 31 Then
or
if range("O62").value - range("N62").value 31 then

both work.
regards
FSt1

"Aaron" wrote:

Sub proving()
Worksheets("Proving Equipment").Visible = True
Sheets("Proving Equipment").Select
If (n62 + 31) < o62 Then
MsgBox ("Proving Equipment Expires Within 1 Month"),
vbInformation, "Proving Kit Check"
Else
'MsgBox ("No Probs"), vbInformation, "Proving Kit Check"
End If
End Sub

I have date formatted n62 and 062, and in the cells I have 16/05/09
and 16/06/09 but when I pause the macro mid stream and hover over the
n62 and o62 it says =empty.

Needless to say it doesent work unless I swap the < sign around.

It always displays the first msg box unless i swap the < then it
displays the other message box. Changing the dates doesent trigger the
change.

I want to allow 31 days before the first msg box pops up.

TIA

Aaron.

  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 3,942
Default Message box date format macro help

oops. the second line should have the sign reversed ie.
if range("O62").value - range("N62").value < 31 then

sorry
regards
FSt1

"FSt1" wrote:

hi
this line..
If (n62 + 31) < o62 Then
i'm not sure if VB is reading these as cell addess much less values in the
celll address ie syntax problem.
try this instead...
If [O62] - [N62] < 31 Then
or
if range("O62").value - range("N62").value 31 then

both work.
regards
FSt1

"Aaron" wrote:

Sub proving()
Worksheets("Proving Equipment").Visible = True
Sheets("Proving Equipment").Select
If (n62 + 31) < o62 Then
MsgBox ("Proving Equipment Expires Within 1 Month"),
vbInformation, "Proving Kit Check"
Else
'MsgBox ("No Probs"), vbInformation, "Proving Kit Check"
End If
End Sub

I have date formatted n62 and 062, and in the cells I have 16/05/09
and 16/06/09 but when I pause the macro mid stream and hover over the
n62 and o62 it says =empty.

Needless to say it doesent work unless I swap the < sign around.

It always displays the first msg box unless i swap the < then it
displays the other message box. Changing the dates doesent trigger the
change.

I want to allow 31 days before the first msg box pops up.

TIA

Aaron.

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
date format problem using Macro mohavv Excel Discussion (Misc queries) 1 October 15th 08 01:09 AM
A macro disabled message comes up but there is no macro. lovetocount Excel Discussion (Misc queries) 2 June 25th 08 12:54 PM
Macro to Change Changing Date Format Data to Text Rod Bowyer Excel Discussion (Misc queries) 3 October 11th 07 12:02 PM
date format changes when I save to CSV via a macro, but not manual brawlsadford Excel Discussion (Misc queries) 4 May 17th 07 09:43 AM
date format changes when I save to CSV via a macro John Taylor Excel Discussion (Misc queries) 4 May 16th 07 01:44 PM


All times are GMT +1. The time now is 10:10 PM.

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

About Us

"It's about Microsoft Excel"