Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

auto date excel, send results to another sheet

30 views
Skip to first unread message

Robert

unread,
Oct 24, 2002, 9:00:11 AM10/24/02
to
Hallo, Dear User Group,
I am new at that so I apologize for that questions.
1) what is the Excel function for automatic date and time
into a cell if clicked on
2) I need to send a result from sheet two to a location
at sheet one
3.) How do I automaticly copy forward functions from the
previous cell, I use now copy and paste for all.
Thank You for Your Help
Robert

J.E. McGimpsey

unread,
Oct 24, 2002, 11:36:04 AM10/24/02
to
There's no automatic date/time entry function in XL. One way using VBA
would be to use the Worksheet_SelectionChange() Event. Put this in the
worksheet code module (right-click on the worksheet tab, choose View
Code, paste the code in the window that opens, then click the XL icon
on the toolbar to return to XL):

Private Sub Worksheet_SelectionChange(ByVal Target As Excel.Range)
With Target
If .Count > 1 Then Exit Sub
If .Address(0, 0) = "A1" Then
With Range("B1")
.Value = Now
.NumberFormat = "dd mmm yyyy hh:mm:ss"
End With
End If
End With
End Sub

Which will put the date/time stamp into B1 whenever A1 is selected.
That means that it will update when A1 is clicked on, tabbed into, etc.

If you want to limit the date/time stamp to mouse action, I'd recommend
using the Worksheet_BeforeDoubleClick event instead:

Private Sub Worksheet_BeforeDoubleClick(ByVal Target As _
Excel.Range, Cancel As Boolean)
With Target
If .Address(0, 0) = "A1" Then
With Range("B1")
.Value = Now
.NumberFormat = "dd mmm yyyy hh:mm:ss"
End With
End If
End With
Cancel = True 'Don't go to edit mode
End Sub

In article <00a301c27b5d$49c7efd0$35ef2ecf@TKMSFTNGXA11>, Robert

J.E. McGimpsey

unread,
Oct 24, 2002, 11:38:30 AM10/24/02
to
The easiest way is probably to enter a "=" sign in your destination
cell in sheet 2, navigate to your source cell in sheet1 and click on
the source cell, then hit return. XL will take you back to Sheet 2 and
the entry will show something like

=Sheet1!A1

Of course, you could enter that directly in your destination cell.

In article <00a301c27b5d$49c7efd0$35ef2ecf@TKMSFTNGXA11>, Robert
<lin...@arco.de> wrote:

0 new messages