LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 57
Default Event macro?

Kent,

Here's a barebones routine that waits for all three cells to change, then
runs your code:

Private Sub Worksheet_Change(ByVal Target As Range)
Static Date1 As Boolean, Date2 As Boolean, Date3 As Boolean
If Not Intersect(Range("B1"), Target) Is Nothing Then ' first cell
Date1 = True
End If
If Not Intersect(Range("C1"), Target) Is Nothing Then ' first cell
Date2 = True
End If
If Not Intersect(Range("D1"), Target) Is Nothing Then ' first cell
Date3 = True
End If

If Date1 = True And Date2 = True And Date3 = True Then
MsgBox "do your code here"
Date1 = False
Date2 = False
Date3 = False
End If
End Sub

The problem is that if the user wants to change only one or two, then go, it
won't go. And it fires when they're cleared (deleted) too. Should not a
button be used to run your code instead?
--
Earl Kiosterud
mvpearl omitthisword at verizon period net
-------------------------------------------

"Kent" wrote in message
...
Is there a way to have a macro automatically run when
dates are entered in cell B1 thru D1?

Any help help would be awesome, thanks.



 
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
Event Macro help Scott Excel Discussion (Misc queries) 3 March 22nd 10 07:19 PM
Event Macro running another macro inside K1KKKA Excel Discussion (Misc queries) 1 December 20th 06 08:21 PM
It seems to me that I need an event Macro, nick s Excel Worksheet Functions 8 November 28th 05 05:37 PM
'Event' macro George Gee New Users to Excel 18 August 27th 05 12:50 PM
Event macro David McRitchie[_2_] Excel Programming 2 July 16th 03 06:20 PM


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