Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default automatically enter time

hi,

i have records in a column. the records are job works to be done. once
o job is done , i mark a "x" in the next column, indicating job
completed. i want the time of compeltion in the third column entered
automatically, once i make a mark in the second column. The mark need
not necessarily be a "x". it could be anything, say like a check box
also.

can it be done???

Thanks for your help..


---
Message posted from http://www.ExcelForum.com/

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,236
Default automatically enter time

Rvik,

Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Column = 2 Then Target.Offset(0, 1).Value = Now()
End Sub

Rob


"rvik " wrote in message
...
hi,

i have records in a column. the records are job works to be done. once
o job is done , i mark a "x" in the next column, indicating job
completed. i want the time of compeltion in the third column entered
automatically, once i make a mark in the second column. The mark need
not necessarily be a "x". it could be anything, say like a check box
also.

can it be done???

Thanks for your help..


---
Message posted from http://www.ExcelForum.com/



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default automatically enter time

ROB,

where do i enter the code... how do i go about it?

--
Message posted from http://www.ExcelForum.com

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default automatically enter time

It goes in the worksheet code module. Right-click on the sheet name tab,
select view Code from the menu, and copy the code in.

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)

"rvik " wrote in message
...
ROB,

where do i enter the code... how do i go about it??


---
Message posted from http://www.ExcelForum.com/



  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default automatically enter time

bob,

it worked, but in column c where the time is supposed to be displaced,
the time is dispalced as #########.

i tried formatting the entire column but in vain. i have to format
each cell individually to display the time


---
Message posted from http://www.ExcelForum.com/



  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default automatically enter time

Just make tyhe column wider.

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)

"rvik " wrote in message
...
bob,

it worked, but in column c where the time is supposed to be displaced,
the time is dispalced as #########.

i tried formatting the entire column but in vain. i have to format
each cell individually to display the time


---
Message posted from http://www.ExcelForum.com/



  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default automatically enter time

bob,

i want only the time to be displace... but widening the column, th
date & time is displaye

--
Message posted from http://www.ExcelForum.com

  #8   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default automatically enter time

Sorry, didn't read the OP

Replace Rob's code with this modified version

Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Column = 2 Then
Target.Offset(0, 1).Value = Now - Date
Target.Offset(0, 1).NumberFormat = "[h]:mm:ss"
End If
End Sub

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)

"rvik " wrote in message
...
bob,

i want only the time to be displace... but widening the column, the
date & time is displayed


---
Message posted from http://www.ExcelForum.com/



  #9   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default automatically enter time

bob,

pooohhhh.... at last i got ir right... thanks a lot bobby...


can u pls look into my other thread "copying data...."

anyway thanks a lot


---
Message posted from http://www.ExcelForum.com/

  #10   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,236
Default automatically enter time

Thanks Bob - missed that one :)
Now - Date is a handy trick.


"Bob Phillips" wrote in message
...
Sorry, didn't read the OP

Replace Rob's code with this modified version

Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Column = 2 Then
Target.Offset(0, 1).Value = Now - Date
Target.Offset(0, 1).NumberFormat = "[h]:mm:ss"
End If
End Sub

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)

"rvik " wrote in message
...
bob,

i want only the time to be displace... but widening the column, the
date & time is displayed


---
Message posted from http://www.ExcelForum.com/







  #11   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,824
Default automatically enter time

Or just
Target.Offset(0, 1).Value = Time



Rob van Gelder wrote:

Thanks Bob - missed that one :)
Now - Date is a handy trick.

"Bob Phillips" wrote in message
...
Sorry, didn't read the OP

Replace Rob's code with this modified version

Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Column = 2 Then
Target.Offset(0, 1).Value = Now - Date
Target.Offset(0, 1).NumberFormat = "[h]:mm:ss"
End If
End Sub

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)

"rvik " wrote in message
...
bob,

i want only the time to be displace... but widening the column, the
date & time is displayed


---
Message posted from http://www.ExcelForum.com/




--

Dave Peterson

  #12   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,236
Default automatically enter time

Dave,

True... It's Friday here. Brain winding down :)

Rob


"Dave Peterson" wrote in message
...
Or just
Target.Offset(0, 1).Value = Time



Rob van Gelder wrote:

Thanks Bob - missed that one :)
Now - Date is a handy trick.

"Bob Phillips" wrote in message
...
Sorry, didn't read the OP

Replace Rob's code with this modified version

Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Column = 2 Then
Target.Offset(0, 1).Value = Now - Date
Target.Offset(0, 1).NumberFormat = "[h]:mm:ss"
End If
End Sub

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)

"rvik " wrote in message
...
bob,

i want only the time to be displace... but widening the column, the
date & time is displayed


---
Message posted from http://www.ExcelForum.com/




--

Dave Peterson



  #13   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default automatically enter time

i want to hide the code and also i would like to have the thrid colum
protected, so that others don't change the time.

If i share thebook, others must beb able to type in only in the secon
column. the thrid column displaying the time , should not be editable

thank

--
Message posted from http://www.ExcelForum.com

  #14   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default automatically enter time

i would like to share this xl sheet on a network and let others also t
mark x in the sheet to record a time but this time should be standar
i.e. it should pick up the time from one central location..say th
server

any solution

--
Message posted from http://www.ExcelForum.com

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
Automatically insert time in excel but not automatically updated NeueN Excel Worksheet Functions 4 December 25th 08 07:29 AM
How do I automatically enter a time and date? Wayne Excel Discussion (Misc queries) 4 September 29th 07 01:42 PM
Enter text automatically based on current time jmj713 Excel Discussion (Misc queries) 3 September 7th 07 04:18 PM
Can I automatically enter the current date or current time into a Ben New Users to Excel 7 October 19th 05 03:38 PM
Automatically enter date and time but only update once. PM New Users to Excel 3 January 21st 05 07:47 AM


All times are GMT +1. The time now is 07:53 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"