Write a macro ro copy column at certain time of day.

  • Thread starter Thread starter Daytrader
  • Start date Start date
D

Daytrader

Hello,
I am using MS Excel2000.
The spread sheet I am using have 9 columns(A - J).
The values of colums C cells are changing constantly. What I am
trying to achive is, I want to take a snapshot of column C exactly at
11:00AM every day and paste it in Column N. Once pasted, those values
of Column N should not change remainder of the day. I then use those
values from Column N to further tabulate other data for the remainder
of the day.
I am doing this manually for now, and looking for faster way to do
this. Any help is appreciated,

Thanks.
 
will this work ?

Sub Copy()
Application.OnTime TimeValue("10:00:00"), "CopyColumn"
End Sub

Sub CopyColumn()
Columns("C:C").Copy
Columns("N:N").Select
Selection.PasteSpecial Paste:=xlValues, Operation:=xlNone, SkipBlanks:=
_
False, Transpose:=False
Application.CutCopyMode = False
End Sub
 
Yes, that should work okay. A suggestion, and a question.

Suggestion. The select is not required, you could use this code

Sub CopyColumn()
Columns("C:C").Copy
Columns("N:N").PasteSpecial Paste:=xlValues, Operation:=xlNone, _
SkipBlanks:=False,
Transpose:=False
Application.CutCopyMode = False
End Sub

Question. What will trigger the Copy macro? To reduce your work, you will
want this automated. Do you know about workbook open code, because that is
probably the best place to put it?

--

HTH

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

Columns("N").Value = Columns("C").Value

--
Regards Ron de Bruin
(Win XP Pro SP-1 XL2000-2003)




Bob Phillips said:
Yes, that should work okay. A suggestion, and a question.

Suggestion. The select is not required, you could use this code

Sub CopyColumn()
Columns("C:C").Copy
Columns("N:N").PasteSpecial Paste:=xlValues, Operation:=xlNone, _
SkipBlanks:=False,
Transpose:=False
Application.CutCopyMode = False
End Sub

Question. What will trigger the Copy macro? To reduce your work, you will
want this automated. Do you know about workbook open code, because that is
probably the best place to put it?

--

HTH

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