Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Copy time from one column to another in a macro

I am trying to create a simple worksheet to log people in / out + in/out when
going to lunch . I need help with code below. Computer asks me to ENTER or
SELECT destination and press ENTER or choose PASTE. When I press ESC on
keyboard the question goes away. Is there a way to tell VBA to press ESC to
correct this problem? If there is a more simple way please advise.

Column A - Name
Column B - Where check goes to say person arrived
Column C - Looks at Column B if checked (NOW())
Column D - Macro copies time from C and pastes as a value
Column E - Repeat of B-D (for Out to Lunch, In from Lunch, Dep. for Day)

Thanks for any help

Robert

Application.ScreenUpdating = False
ActiveCell.FormulaR1C1 = "R"
ActiveCell.Offset(0, 1).Select
Selection.Copy
ActiveCell.Offset(0, 1).Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone,
SkipBlanks _
:=False, Transpose:=False
Application.OnKey "{ENTER}"
Range("AZ1").Select
ActiveCell.FormulaR1C1 = "=+TODAY()"
Range("A1").Select
ActiveCell.Select

End Sub
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 63
Default Copy time from one column to another in a macro

Robert,

To clear the clipboard, put this in your code:

application.CutCopyMode = false

hth,

Doug

"Robert B." <Robert wrote in message
...
I am trying to create a simple worksheet to log people in / out + in/out
when
going to lunch . I need help with code below. Computer asks me to ENTER
or
SELECT destination and press ENTER or choose PASTE. When I press ESC on
keyboard the question goes away. Is there a way to tell VBA to press ESC
to
correct this problem? If there is a more simple way please advise.

Column A - Name
Column B - Where check goes to say person arrived
Column C - Looks at Column B if checked (NOW())
Column D - Macro copies time from C and pastes as a value
Column E - Repeat of B-D (for Out to Lunch, In from Lunch, Dep. for Day)

Thanks for any help

Robert

Application.ScreenUpdating = False
ActiveCell.FormulaR1C1 = "R"
ActiveCell.Offset(0, 1).Select
Selection.Copy
ActiveCell.Offset(0, 1).Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone,
SkipBlanks _
:=False, Transpose:=False
Application.OnKey "{ENTER}"
Range("AZ1").Select
ActiveCell.FormulaR1C1 = "=+TODAY()"
Range("A1").Select
ActiveCell.Select

End Sub


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 26
Default Copy time from one column to another in a macro

Mr. Glancy,

Thanks much for the code below. It worked perfectly. I have another
question. I currently have to select each of the four cells (Entry,Exit, Out
to Lunch or In from Lunch) by clicking on cell in left side. The right side
of each cell I have a transparent rectangle attached to the marcro. Is
there a way to make it when I click anywhere in each of the cells listed
above it will activate the macro?

Thanks for any help you can provide.

Robert
"Doug Glancy" wrote:

Robert,

To clear the clipboard, put this in your code:

application.CutCopyMode = false

hth,

Doug

"Robert B." <Robert wrote in message
...
I am trying to create a simple worksheet to log people in / out + in/out
when
going to lunch . I need help with code below. Computer asks me to ENTER
or
SELECT destination and press ENTER or choose PASTE. When I press ESC on
keyboard the question goes away. Is there a way to tell VBA to press ESC
to
correct this problem? If there is a more simple way please advise.

Column A - Name
Column B - Where check goes to say person arrived
Column C - Looks at Column B if checked (NOW())
Column D - Macro copies time from C and pastes as a value
Column E - Repeat of B-D (for Out to Lunch, In from Lunch, Dep. for Day)

Thanks for any help

Robert

Application.ScreenUpdating = False
ActiveCell.FormulaR1C1 = "R"
ActiveCell.Offset(0, 1).Select
Selection.Copy
ActiveCell.Offset(0, 1).Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone,
SkipBlanks _
:=False, Transpose:=False
Application.OnKey "{ENTER}"
Range("AZ1").Select
ActiveCell.FormulaR1C1 = "=+TODAY()"
Range("A1").Select
ActiveCell.Select

End Sub



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 63
Default Copy time from one column to another in a macro

Robert,

Take a look at the Worksheet_SelectionChange event. Look it up in Help or
Google it. I think it will do what you want. Sorry, don't have time for
more now.

Doug

"Robert B." wrote in message
...
Mr. Glancy,

Thanks much for the code below. It worked perfectly. I have another
question. I currently have to select each of the four cells (Entry,Exit,
Out
to Lunch or In from Lunch) by clicking on cell in left side. The right
side
of each cell I have a transparent rectangle attached to the marcro. Is
there a way to make it when I click anywhere in each of the cells listed
above it will activate the macro?

Thanks for any help you can provide.

Robert
"Doug Glancy" wrote:

Robert,

To clear the clipboard, put this in your code:

application.CutCopyMode = false

hth,

Doug

"Robert B." <Robert wrote in message
...
I am trying to create a simple worksheet to log people in / out + in/out
when
going to lunch . I need help with code below. Computer asks me to
ENTER
or
SELECT destination and press ENTER or choose PASTE. When I press ESC
on
keyboard the question goes away. Is there a way to tell VBA to press
ESC
to
correct this problem? If there is a more simple way please advise.

Column A - Name
Column B - Where check goes to say person arrived
Column C - Looks at Column B if checked (NOW())
Column D - Macro copies time from C and pastes as a value
Column E - Repeat of B-D (for Out to Lunch, In from Lunch, Dep. for
Day)

Thanks for any help

Robert

Application.ScreenUpdating = False
ActiveCell.FormulaR1C1 = "R"
ActiveCell.Offset(0, 1).Select
Selection.Copy
ActiveCell.Offset(0, 1).Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone,
SkipBlanks _
:=False, Transpose:=False
Application.OnKey "{ENTER}"
Range("AZ1").Select
ActiveCell.FormulaR1C1 = "=+TODAY()"
Range("A1").Select
ActiveCell.Select

End Sub




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
Macro for a one time triggered copy of cell value Azrael[_2_] Excel Discussion (Misc queries) 8 March 4th 09 04:24 PM
copy cell with macro and increment down each time RJJ Excel Worksheet Functions 6 May 9th 08 06:16 PM
Copy rows multiple times changing value of a cell in one column each time EE[_2_] Excel Programming 1 October 11th 07 01:13 PM
Best way to copy time sensitive data to a column william Excel Worksheet Functions 0 May 4th 06 05:54 PM
Write a macro ro copy column at certain time of day. Daytrader Excel Programming 2 February 2nd 04 05:28 AM


All times are GMT +1. The time now is 04:16 AM.

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

About Us

"It's about Microsoft Excel"