Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I have this working except that I want 09/19/05 to equal Today()'s date
What would this line need to look like? Range("Q4") = "09/19/05" ------------ If Target.Address = "$P$4" Then If Range("Q4") = "mm/dd" Then Range("Q4") = "09/19/05" Range("C12").Select Else Range("Q4") = "mm/dd" Range("Q4").Select End If End If ------------ |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
With Range("Q4")
.value = date .numberformat = "mm/dd/yy" end with CRayF wrote: I have this working except that I want 09/19/05 to equal Today()'s date What would this line need to look like? Range("Q4") = "09/19/05" ------------ If Target.Address = "$P$4" Then If Range("Q4") = "mm/dd" Then Range("Q4") = "09/19/05" Range("C12").Select Else Range("Q4") = "mm/dd" Range("Q4").Select End If End If ------------ -- Dave Peterson |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Works like a champ... thanks
If Target.Address = "$P$4" Then If Range("Q4") = "mm/dd" Then With Range("Q4") .Value = Date .NumberFormat = "mm/dd/yy" End With Range("C12").Select Else Range("Q4") = "mm/dd" Range("Q4").Select End If End If "Dave Peterson" wrote: With Range("Q4") .value = date .numberformat = "mm/dd/yy" end with |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
On Mon, 19 Sep 2005 12:07:03 -0700, "CRayF"
wrote: I have this working except that I want 09/19/05 to equal Today()'s date What would this line need to look like? Range("Q4") = "09/19/05" ------------ If Target.Address = "$P$4" Then If Range("Q4") = "mm/dd" Then Range("Q4") = "09/19/05" Range("C12").Select Else Range("Q4") = "mm/dd" Range("Q4").Select End If End If ------------ Probably you want to use the Date function: Range("Q4") = Date --ron |
#5
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Thanks... All works great...
This is what I ended up with... P4 starts out as a value of "T" and Q4 equals "<- Click" When P4 ("T"oday) is selected , it places todays date in Q4 and changes P4 to a "C" for "Clear". When selected again ("C") then it replaces todays date with "<- Click". and P4 back to "T". This toggles back and forth when selected. --------------- If Target.Address = "$P$4" Then If Range("Q4") = "<- Click" Then With Range("Q4") Range("Q4") = Date Range("P4") = "C" End With Range("C12").Select Else Range("Q4") = "<- Click" Range("P4") = "T" Range("Q4").Select End If End If --------------------------- "Ron Rosenfeld" wrote: On Mon, 19 Sep 2005 12:07:03 -0700, "CRayF" wrote: I have this working except that I want 09/19/05 to equal Today()'s date What would this line need to look like? Range("Q4") = "09/19/05" ------------ If Target.Address = "$P$4" Then If Range("Q4") = "mm/dd" Then Range("Q4") = "09/19/05" Range("C12").Select Else Range("Q4") = "mm/dd" Range("Q4").Select End If End If ------------ Probably you want to use the Date function: Range("Q4") = Date --ron |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Today variable to calender control | Excel Discussion (Misc queries) | |||
Sub to aquire list of worksheets | Excel Programming | |||
Sub to aquire list of worksheets | Excel Programming | |||
Sub to aquire list of worksheets | Excel Programming | |||
Sub to aquire list of worksheets | Excel Programming |