View Single Post
  #7   Report Post  
Posted to microsoft.public.excel.programming
Orion[_2_] Orion[_2_] is offline
external usenet poster
 
Posts: 35
Default command to be run at a certain date

I tried this following code, which doesn't do the job. Can anyone tell
me please, why?

Private Sub App_WorkbookOpen()
'
If Now() 31 / 1 / 2005 Then
With Worksheets(Sheet1)
Cells.Select
Selection.Copy
Selection.PasteSpecial Paste:=xlValues, Operation:=xlNone,
SkipBlanks:= _
False, Transpose:=False
End With
End If
Range("A1").Select
Application.CutCopyMode = False
ActiveWorkbook.Save
End Sub


Thanks,
Norbert


On Tue, 01 Feb 2005 12:37:08 +0200, Orion wrote:

Nick,
thank you very much for your suggestions. Your Air-code (whatever that
is (it reminds me on sth. like playing air-guitar?!?) will work
exactely as I want, I just hope I get it going.

The scheduler wouldn't be better in this case as the spreadsheet won't
run on my computer and I don't have any influence on the scheduler of
the other side.

But thanks anyway.

Regards,
Norbert



On Tue, 1 Feb 2005 17:06:14 +0800, "NickHK"
wrote:

Norbert,
The previous post assumes it is OK to run this the next time the WB is
opened, whenever that is.
If you need to run it exactly at that time, may the Task Scheduler would be
better.

NickHK

"NickHK" wrote in message
...
Norbert,
You could put a check in the Workbook_Open event and check:
<Air-code
If Now()MyDate then
With Worksheets(MyWS)
.Cells.Copy
.PasteSpecial Paste:=xlValues, Operation:=xlNone, SkipBlanks:=
False, Transpose:=False
End with
End if
</Air-code

NickHK

"Orion" wrote in message
...
Hi everybody,

is there a way to run a command at a certain date?
E.g.: Delete all formulas of worksheet "A" and replace them by the
cells value on the 01.04.2005 10:00am.

Any help is very much appreciated.

Thanks
Norbert