#1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 17
Default error trap

Hi,

I also need some sort of error trapping here. If the
person missed doing the refresh at 24th and, for example
opened it on the 28th, I need the refresh to execute.
Somehow it has to check if it had refreshed on the 24th
and if not, and it's still within the same month, I need
it to be able to refresh then. But not anymore for the
rest of that month. I need help!!!








Private Sub Refresh_Button_Click()
If Date = DateSerial(Year(Date), Month(Date), 24)
Then
MsgBox "This is the 24th day of the Month. Your
data will be updated."

' RefreshMeters Macro
' Macro recorded 30/09/2003 by rhocarit
'
' Keyboard Shortcut: Ctrl+a
'
ActiveWorkbook.RefreshAll

Else
MsgBox "This is NOT the 24th day of the Month.
Your data has NOT been updated."
End If
End Sub
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 576
Default error trap

Rhonda,

The easiest way is to have the refresh code put a date stamp in a cell.
Than you can check that cell to see when it was updated.

Range("A1") = Date

--
sb
"Rhonda" wrote in message
...
Hi,

I also need some sort of error trapping here. If the
person missed doing the refresh at 24th and, for example
opened it on the 28th, I need the refresh to execute.
Somehow it has to check if it had refreshed on the 24th
and if not, and it's still within the same month, I need
it to be able to refresh then. But not anymore for the
rest of that month. I need help!!!








Private Sub Refresh_Button_Click()
If Date = DateSerial(Year(Date), Month(Date), 24)
Then
MsgBox "This is the 24th day of the Month. Your
data will be updated."

' RefreshMeters Macro
' Macro recorded 30/09/2003 by rhocarit
'
' Keyboard Shortcut: Ctrl+a
'
ActiveWorkbook.RefreshAll

Else
MsgBox "This is NOT the 24th day of the Month.
Your data has NOT been updated."
End If
End Sub



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default error trap

It would be hard to offer any code for this condition:

Somehow it has to check if it had refreshed on the 24th


How could that be determined?

--
Regards,
Tom Ogilvy


"Rhonda" wrote in message
...
Hi,

I also need some sort of error trapping here. If the
person missed doing the refresh at 24th and, for example
opened it on the 28th, I need the refresh to execute.
Somehow it has to check if it had refreshed on the 24th
and if not, and it's still within the same month, I need
it to be able to refresh then. But not anymore for the
rest of that month. I need help!!!








Private Sub Refresh_Button_Click()
If Date = DateSerial(Year(Date), Month(Date), 24)
Then
MsgBox "This is the 24th day of the Month. Your
data will be updated."

' RefreshMeters Macro
' Macro recorded 30/09/2003 by rhocarit
'
' Keyboard Shortcut: Ctrl+a
'
ActiveWorkbook.RefreshAll

Else
MsgBox "This is NOT the 24th day of the Month.
Your data has NOT been updated."
End If
End Sub



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
How to error trap "... cannot find the data..." message? [email protected] Excel Discussion (Misc queries) 4 August 29th 08 02:57 AM
Error.Type or IsError to trap #VALUE! and #NUM! Ms. AEB Excel Worksheet Functions 1 July 19th 07 06:51 PM
Cleaner Error trap in Loop. plys Excel Discussion (Misc queries) 3 January 20th 07 03:31 AM
Best way to trap error to MsgBox "Too many cell formats" [email protected] Excel Discussion (Misc queries) 0 August 22nd 06 09:52 PM


All times are GMT +1. The time now is 08:20 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"