Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 298
Default Formula - Time, Cell

Hello,
I am having a hard time trying to figure out how to do the following

Basically I have an excel sheet with several columns.
Coloumn A = Account Number
Coloumn B = Time

I would like to have some sort of formula that automaticall enters the time
(only the time of day) in (b2) when they enter an account number in cell (a2)

I tried making a macro but it was not working properly can anyone PLEASE help
Thanks in Advance
-Rich



  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 983
Default Formula - Time, Cell

Here is the macro you need. You need to paste this into the code for the
sheet you want. In Excel Right Click on the tab where you want this to
happen. Select View Code. Paste this code into the window.

Private Sub Worksheet_Change(ByVal Target As Range)

If Target.Row 1 And Target.Column = 1 Then
Target.Offset(0, 1).Value = Time
End If
End Sub

This returns only the current system time. If you want it to be the current
date and time change the word time to now in the code.

HTH

"Rich" wrote:

Hello,
I am having a hard time trying to figure out how to do the following

Basically I have an excel sheet with several columns.
Coloumn A = Account Number
Coloumn B = Time

I would like to have some sort of formula that automaticall enters the time
(only the time of day) in (b2) when they enter an account number in cell (a2)

I tried making a macro but it was not working properly can anyone PLEASE help
Thanks in Advance
-Rich



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 298
Default Formula - Time, Cell

JIm THanks for the help but maybe i did not explain myself well.

What i have is a spreadsheet with 7 coloumns and 30 rows
Column B is "Account Number"
Column C is "Time"

Each time someone enters an account # into Coulumn B I want to generate the
exact time in Column C

And I need to have it do this for each of the 30 rows.

Hope this is easier to understand..and again, thanks!











"Jim Thomlinson" wrote:

Here is the macro you need. You need to paste this into the code for the
sheet you want. In Excel Right Click on the tab where you want this to
happen. Select View Code. Paste this code into the window.

Private Sub Worksheet_Change(ByVal Target As Range)

If Target.Row 1 And Target.Column = 1 Then
Target.Offset(0, 1).Value = Time
End If
End Sub

This returns only the current system time. If you want it to be the current
date and time change the word time to now in the code.

HTH

"Rich" wrote:

Hello,
I am having a hard time trying to figure out how to do the following

Basically I have an excel sheet with several columns.
Coloumn A = Account Number
Coloumn B = Time

I would like to have some sort of formula that automaticall enters the time
(only the time of day) in (b2) when they enter an account number in cell (a2)

I tried making a macro but it was not working properly can anyone PLEASE help
Thanks in Advance
-Rich



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 983
Default Formula - Time, Cell

Private Sub Worksheet_Change(ByVal Target As Range)

If Target.Row 1 And Target.Row < 31 And Target.Column = 2 Then
Target.Offset(0, 1).Value = Time
End If
End Sub

This code will do the following.
If you change a value in Column B between rows 2 through 30, then in column
C it will add the current time right beside the account that you just changed.

By changing the 1, 31 and 2 you can change how this works. I hope this is
what you are looking for...
"Rich" wrote:

JIm THanks for the help but maybe i did not explain myself well.

What i have is a spreadsheet with 7 coloumns and 30 rows
Column B is "Account Number"
Column C is "Time"

Each time someone enters an account # into Coulumn B I want to generate the
exact time in Column C

And I need to have it do this for each of the 30 rows.

Hope this is easier to understand..and again, thanks!











"Jim Thomlinson" wrote:

Here is the macro you need. You need to paste this into the code for the
sheet you want. In Excel Right Click on the tab where you want this to
happen. Select View Code. Paste this code into the window.

Private Sub Worksheet_Change(ByVal Target As Range)

If Target.Row 1 And Target.Column = 1 Then
Target.Offset(0, 1).Value = Time
End If
End Sub

This returns only the current system time. If you want it to be the current
date and time change the word time to now in the code.

HTH

"Rich" wrote:

Hello,
I am having a hard time trying to figure out how to do the following

Basically I have an excel sheet with several columns.
Coloumn A = Account Number
Coloumn B = Time

I would like to have some sort of formula that automaticall enters the time
(only the time of day) in (b2) when they enter an account number in cell (a2)

I tried making a macro but it was not working properly can anyone PLEASE help
Thanks in Advance
-Rich



  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Formula - Time, Cell

That's pretty much what his code does except it works for entries in column
B on all rows but row 1. What do you think it does?

--
Regards,
Tom Ogilvy


"Rich" wrote in message
...
JIm THanks for the help but maybe i did not explain myself well.

What i have is a spreadsheet with 7 coloumns and 30 rows
Column B is "Account Number"
Column C is "Time"

Each time someone enters an account # into Coulumn B I want to generate

the
exact time in Column C

And I need to have it do this for each of the 30 rows.

Hope this is easier to understand..and again, thanks!











"Jim Thomlinson" wrote:

Here is the macro you need. You need to paste this into the code for the
sheet you want. In Excel Right Click on the tab where you want this to
happen. Select View Code. Paste this code into the window.

Private Sub Worksheet_Change(ByVal Target As Range)

If Target.Row 1 And Target.Column = 1 Then
Target.Offset(0, 1).Value = Time
End If
End Sub

This returns only the current system time. If you want it to be the

current
date and time change the word time to now in the code.

HTH

"Rich" wrote:

Hello,
I am having a hard time trying to figure out how to do the following

Basically I have an excel sheet with several columns.
Coloumn A = Account Number
Coloumn B = Time

I would like to have some sort of formula that automaticall enters the

time
(only the time of day) in (b2) when they enter an account number in

cell (a2)

I tried making a macro but it was not working properly can anyone

PLEASE help
Thanks in Advance
-Rich







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
formula to insert time of day in excel cell novice123 Excel Worksheet Functions 1 July 12th 09 07:14 PM
formula to insert time of day in excel cell novice 123 Excel Worksheet Functions 1 July 11th 09 11:53 PM
formula to insert time of day in excel cell novice567 Excel Discussion (Misc queries) 1 July 11th 09 11:17 PM
formula to insert time of day in excel cell novice 123 Excel Worksheet Functions 0 July 11th 09 11:03 PM
formula for a cell changes over time [email protected] Excel Discussion (Misc queries) 0 November 21st 07 10:10 PM


All times are GMT +1. The time now is 04:42 PM.

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"