Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
code to input date after diff. cell selected
basically i want to insert a date in to one cell but only if i select another
cell... make sense??? i attempted the following but had no result considering the Range("D3").... selects the cell... can anyone help Sub Insert_Date() If Range("D2").Select Then cell = ("L4") = "" Else cell = ("L4") = "=TODAY()" End If End Sub -- "The difference between Possible and Impossible is the measure of ones will" |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
code to input date after diff. cell selected
Not sure of the logic of what you are trying to achieve, but use the
Worksheet_SelectionChange event : Private Sub Worksheet_SelectionChange(ByVal Target As Range) If Target.Address = Range("D2").Address Then Range("L4").Value = "" Else Range("L4").Formula = "=TODAY()" 'Or 'Range("L4").Formula = Now() End If End Sub NickHK "Kelzina" wrote in message ... basically i want to insert a date in to one cell but only if i select another cell... make sense??? i attempted the following but had no result considering the Range("D3").... selects the cell... can anyone help Sub Insert_Date() If Range("D2").Select Then cell = ("L4") = "" Else cell = ("L4") = "=TODAY()" End If End Sub -- "The difference between Possible and Impossible is the measure of ones will" |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
code to input date after diff. cell selected
nevermind, my explanation is prolly to confusing, ill try something else,
thanx anyway -- "The difference between Possible and Impossible is the measure of ones will" "NickHK" wrote: Not sure of the logic of what you are trying to achieve, but use the Worksheet_SelectionChange event : Private Sub Worksheet_SelectionChange(ByVal Target As Range) If Target.Address = Range("D2").Address Then Range("L4").Value = "" Else Range("L4").Formula = "=TODAY()" 'Or 'Range("L4").Formula = Now() End If End Sub NickHK "Kelzina" wrote in message ... basically i want to insert a date in to one cell but only if i select another cell... make sense??? i attempted the following but had no result considering the Range("D3").... selects the cell... can anyone help Sub Insert_Date() If Range("D2").Select Then cell = ("L4") = "" Else cell = ("L4") = "=TODAY()" End If End Sub -- "The difference between Possible and Impossible is the measure of ones will" |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
vb code to copy and list selected row to diff sheets | Excel Discussion (Misc queries) | |||
Automatically input a symbol in a selected cell | Excel Discussion (Misc queries) | |||
Code to Query SQL Server with a parameter value (entered into an Input Box), and have that value also display in a selected cell on a worksheet | Excel Discussion (Misc queries) | |||
Code to Query SQL Server with a parameter value (entered into an Input Box), and have that value also display in a selected cell on a worksheet | Excel Worksheet Functions | |||
calculate date diff in a cell | Excel Programming |