PC Review


Reply
Thread Tools Rate Thread

code to input date after diff. cell selected

 
 
=?Utf-8?B?S2VsemluYQ==?=
Guest
Posts: n/a
 
      22nd Nov 2006
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 With Quote
 
 
 
 
NickHK
Guest
Posts: n/a
 
      22nd Nov 2006
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" <(E-Mail Removed)> wrote in message
news:066E3E36-7F32-47F8-9431-(E-Mail Removed)...
> 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 With Quote
 
=?Utf-8?B?S2VsemluYQ==?=
Guest
Posts: n/a
 
      22nd Nov 2006
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" <(E-Mail Removed)> wrote in message
> news:066E3E36-7F32-47F8-9431-(E-Mail Removed)...
> > 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 With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
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 Doctorjones_md Microsoft Excel Discussion 1 27th Jun 2007 04:14 PM
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 Doctorjones_md Microsoft Excel Programming 3 27th Jun 2007 04:14 PM
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 Doctorjones_md Microsoft Excel Misc 3 27th Jun 2007 04:14 PM
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 Doctorjones_md Microsoft Excel Worksheet Functions 3 27th Jun 2007 04:14 PM
need help with vba code to input data on certain date and move to next cell for the following date. meghantrus@hotmail.com Microsoft Outlook VBA Programming 1 30th May 2007 04:45 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 02:05 PM.