Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 23
Default Using date as trigger for macro

I want to write a macro, that will look for today's date in a database, and
if it finds it, do another action. I have already designed the other action.

Thanks!

Mike
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 77
Default Using date as trigger for macro

Hi Mike,

I'm no expert at macros, but you could try:

Worksheets(1).Range("a1") = ""
'dont forget to format cell a1 as the date that the other cell in your
database is.
Worksheets(1).Range("a1") = "=NOW()"

'where "worksheets(?).range("??").text" is the date somewhere in your
database. 'I used b1
If Worksheets(1).Range("a1").Text = Worksheets(1).Range("b1").Text Then
'if same do something
Worksheets(1).Range("c1").Value = "yep they're the same"
Else
'if not do something else
Worksheets(1).Range("c1").Value = "nope they're not"

End If


hth

BigPig

"Mike Milmoe" wrote:

I want to write a macro, that will look for today's date in a database, and
if it finds it, do another action. I have already designed the other action.

Thanks!

Mike

  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 11,058
Default Using date as trigger for macro

Sub milmoe()
Set r = Range("A1:A100")
For Each rr In r
If rr.Value = DateValue(Now()) Then
MsgBox ("call your macro here")
End If
Next
End Sub

--
Gary''s Student - gsnu200720


"Mike Milmoe" wrote:

I want to write a macro, that will look for today's date in a database, and
if it finds it, do another action. I have already designed the other action.

Thanks!

Mike

  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 23
Default Using date as trigger for macro

This worked great. Thanks alot

Mike

"Gary''s Student" wrote:

Sub milmoe()
Set r = Range("A1:A100")
For Each rr In r
If rr.Value = DateValue(Now()) Then
MsgBox ("call your macro here")
End If
Next
End Sub

--
Gary''s Student - gsnu200720


"Mike Milmoe" wrote:

I want to write a macro, that will look for today's date in a database, and
if it finds it, do another action. I have already designed the other action.

Thanks!

Mike

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 can I get a date in exel to trigger a reminder in 30 days? tigerfan Excel Discussion (Misc queries) 0 March 13th 06 11:11 PM
macro trigger Leslieac Excel Discussion (Misc queries) 3 February 2nd 06 09:08 PM
trigger help climax Excel Worksheet Functions 1 February 2nd 06 04:39 PM
trigger problem climax Excel Discussion (Misc queries) 1 February 2nd 06 12:39 AM
Recurring annual events using a specific date as a trigger date Bamboozled Excel Worksheet Functions 1 June 6th 05 01:44 PM


All times are GMT +1. The time now is 01:52 AM.

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"