Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.newusers
external usenet poster
 
Posts: 51
Default One click time

I know the question has been asked and the simple answer is ctrl - shift - :
to add time in a cell. Unfortunatly sometimes the easy solution is still
difficult. I would like to know how to click on a cell and have the time
appear. Because i do security patrols and my laptop is mounted in my vehicle.
It"s difficult to type unless i stop to look at the keyboard and it's still
typing with one hand. If anyone is willing to tell that would be great. I am
new to excel and i am willing for trial and error. Thanks
  #2   Report Post  
Posted to microsoft.public.excel.newusers
external usenet poster
 
Posts: 11,501
Default One click time

Hi,

It colud be done like this. Right click your sheet tab, view code and paste
this in on the right. Change the 5 (Column E) to the appropriate column. It
can be written so that this only happens in certain cells and if you need
more help post back.

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
If Target.Column = 5 Then
If IsEmpty(Target) Then Target.Value = Time
End If
End Sub

Mike

"doss04" wrote:

I know the question has been asked and the simple answer is ctrl - shift - :
to add time in a cell. Unfortunatly sometimes the easy solution is still
difficult. I would like to know how to click on a cell and have the time
appear. Because i do security patrols and my laptop is mounted in my vehicle.
It"s difficult to type unless i stop to look at the keyboard and it's still
typing with one hand. If anyone is willing to tell that would be great. I am
new to excel and i am willing for trial and error. Thanks

  #3   Report Post  
Posted to microsoft.public.excel.newusers
external usenet poster
 
Posts: 51
Default One click time

Thanks it worked. But when i tried to do another column it popped up with an
error. basicly saying i can't do it the way i did. So how would i go about
doing 2 columns

"Mike H" wrote:

Hi,

It colud be done like this. Right click your sheet tab, view code and paste
this in on the right. Change the 5 (Column E) to the appropriate column. It
can be written so that this only happens in certain cells and if you need
more help post back.

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
If Target.Column = 5 Then
If IsEmpty(Target) Then Target.Value = Time
End If
End Sub

Mike

"doss04" wrote:

I know the question has been asked and the simple answer is ctrl - shift - :
to add time in a cell. Unfortunatly sometimes the easy solution is still
difficult. I would like to know how to click on a cell and have the time
appear. Because i do security patrols and my laptop is mounted in my vehicle.
It"s difficult to type unless i stop to look at the keyboard and it's still
typing with one hand. If anyone is willing to tell that would be great. I am
new to excel and i am willing for trial and error. Thanks

  #4   Report Post  
Posted to microsoft.public.excel.newusers
external usenet poster
 
Posts: 51
Default One click time

Disregard last post. I figured it out. Thanks, you guys are really helping
make my job easier and more efficient.

"Mike H" wrote:

Hi,

It colud be done like this. Right click your sheet tab, view code and paste
this in on the right. Change the 5 (Column E) to the appropriate column. It
can be written so that this only happens in certain cells and if you need
more help post back.

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
If Target.Column = 5 Then
If IsEmpty(Target) Then Target.Value = Time
End If
End Sub

Mike

"doss04" wrote:

I know the question has been asked and the simple answer is ctrl - shift - :
to add time in a cell. Unfortunatly sometimes the easy solution is still
difficult. I would like to know how to click on a cell and have the time
appear. Because i do security patrols and my laptop is mounted in my vehicle.
It"s difficult to type unless i stop to look at the keyboard and it's still
typing with one hand. If anyone is willing to tell that would be great. I am
new to excel and i am willing for trial and error. Thanks

  #5   Report Post  
Posted to microsoft.public.excel.newusers
external usenet poster
 
Posts: 51
Default One click time

I figured out how to do both columns. i think i missed a step somewhere. I
closed out the worksheet and saved the changes. But when i opened it again it
didn't work. I looked on the screen where i typed the changes, the changes
was still there. but it didn't work. Itried to retype it. Nothing the cells
are still formatted hh:mm. But the clicking on the cell is gone. Any
suggestions? Thanks


"Mike H" wrote:

Hi,

It colud be done like this. Right click your sheet tab, view code and paste
this in on the right. Change the 5 (Column E) to the appropriate column. It
can be written so that this only happens in certain cells and if you need
more help post back.

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
If Target.Column = 5 Then
If IsEmpty(Target) Then Target.Value = Time
End If
End Sub

Mike

"doss04" wrote:

I know the question has been asked and the simple answer is ctrl - shift - :
to add time in a cell. Unfortunatly sometimes the easy solution is still
difficult. I would like to know how to click on a cell and have the time
appear. Because i do security patrols and my laptop is mounted in my vehicle.
It"s difficult to type unless i stop to look at the keyboard and it's still
typing with one hand. If anyone is willing to tell that would be great. I am
new to excel and i am willing for trial and error. Thanks



  #6   Report Post  
Posted to microsoft.public.excel.newusers
external usenet poster
 
Posts: 35,218
Default One click time

There is no click event that you can tie into. You could use the
_selectionchange event that Mike suggested, but you may find that you're
changing things you don't want changed.

I'd recommend either the _beforerightclick or _beforedoubleclick event.

I'd use one of these (not both):

Option Explicit
Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As
Boolean)

Cancel = True

'doubleclick anywhere, but only column E can change
With ActiveCell.EntireRow.Range("e1")
.NumberFormat = "mm/dd/yyyy hh:mm:ss"
.Value = Now
End With

End Sub

Private Sub Worksheet_BeforeRightClick(ByVal Target As Range, Cancel As Boolean)

Cancel = True

'rightclick anywhere, but only column E can change
With ActiveCell.EntireRow.Range("e1")
.NumberFormat = "mm/dd/yyyy hh:mm:ss"
.Value = Now
End With

End Sub

Rightclick on the worksheet tab that should have this behavior and select view
code. Paste this (one of them!) into the code window that opens up.

Then back to excel and test it.

doss04 wrote:

I know the question has been asked and the simple answer is ctrl - shift - :
to add time in a cell. Unfortunatly sometimes the easy solution is still
difficult. I would like to know how to click on a cell and have the time
appear. Because i do security patrols and my laptop is mounted in my vehicle.
It"s difficult to type unless i stop to look at the keyboard and it's still
typing with one hand. If anyone is willing to tell that would be great. I am
new to excel and i am willing for trial and error. Thanks


--

Dave Peterson
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
Help calculating off time with only one click [email protected] Excel Discussion (Misc queries) 2 February 19th 08 04:29 PM
Different Results in each time I click on F9 Simone Excel Worksheet Functions 3 November 5th 07 07:59 PM
How do I make a chart pop up each time I click on a cell ? Alex Charts and Charting in Excel 0 March 12th 07 12:43 PM
change value with single click, increasing by 1 every time? jkbrown Excel Discussion (Misc queries) 3 May 4th 06 12:49 AM
how do I format the sheet so that I may click on 1 cell at a time Nikki B Excel Worksheet Functions 1 February 24th 06 06:35 PM


All times are GMT +1. The time now is 01:26 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"