Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 99
Default Macro that will detemine date and then check off a box

I have a cell titled Commit Date that you will fill in a date. At the top of
the spreadhseet I have the current date. I need a macro that takes the
current date plus 7 days and checks a box off (Lists it as a Focus Item) if
the commit date falls within that date range.

I'm new at macros and am completley lost on this one. Any help would be
greatly appreciated!

Thank You, Wendy
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 10,593
Default Macro that will detemine date and then check off a box

Wendy,

I am not sure what you mean by checks a box off (Lists it as a Focus Item),
but this code puts a tick besaide the date if it meets.

It assumes Commit Date is in C3, and sets the tick when it cahnges.

Private Sub Worksheet_Change(ByVal Target As Range)
Const WS_RANGE As String = "C3" '<== change to suit

On Error GoTo ws_exit
Application.EnableEvents = False

If Not Intersect(Target, Me.Range(WS_RANGE)) Is Nothing Then
With Target
If .Value = Date And .Value <= Date + 7 Then
.Offset(0, 1).Value = "a"
.Offset(0, 1).Font.Name = "Marlett"
Else
.Offset(0, 1).Value = ""
End If
End With
End If

ws_exit:
Application.EnableEvents = True
End Sub

'This is worksheet event code, which means that it needs to be
'placed in the appropriate worksheet code module, not a standard
'code module. To do this, right-click on the sheet tab, select
'the View Code option from the menu, and paste the code in.


--
HTH

Bob

(there's no email, no snail mail, but somewhere should be gmail in my addy)

"Wendy" wrote in message
...
I have a cell titled Commit Date that you will fill in a date. At the top
of
the spreadhseet I have the current date. I need a macro that takes the
current date plus 7 days and checks a box off (Lists it as a Focus Item)
if
the commit date falls within that date range.

I'm new at macros and am completley lost on this one. Any help would be
greatly appreciated!

Thank You, Wendy



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
Function to detemine whether function or value in cell nc Excel Discussion (Misc queries) 5 December 1st 06 03:33 PM
To be safe - how to check macro before run it? Eric Excel Discussion (Misc queries) 2 April 21st 06 12:31 AM
need macro to check part# and sum jg53 Excel Worksheet Functions 8 April 13th 06 04:29 PM
Using a Macro to clear out check box seletions Mel Excel Worksheet Functions 5 May 20th 05 08:35 PM
How do I link a check box to a macro? Tom Excel Worksheet Functions 1 April 12th 05 04:37 AM


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