Wrox Programmer Forums
|
Excel VBA Discuss using VBA for Excel programming.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Excel VBA section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old February 18th, 2007, 05:11 PM
Friend of Wrox
 
Join Date: May 2005
Posts: 189
Thanks: 0
Thanked 0 Times in 0 Posts
Default F9-key

Hei!

When pushing F9-key on the keyboard, the excel-sheet is being calculated (run). But what are the code behind the F9-key?

Mvh
grstad
__________________
Internet has become favorable with that tool...thank you Tim Berners-Lee!
 
Old February 22nd, 2007, 09:59 AM
Authorized User
 
Join Date: Sep 2006
Posts: 13
Thanks: 0
Thanked 0 Times in 0 Posts
Default

The vb command executed is Calculate


Often I use ActiveSheet.Calculate to control calculation

the following sets the workbook to manual calculation
Application.Calculation = xlManual
Application.CalculateBeforeSave = False


DG
 
Old February 23rd, 2007, 11:12 AM
Friend of Wrox
 
Join Date: May 2005
Posts: 189
Thanks: 0
Thanked 0 Times in 0 Posts
Default

...ok and thank you DaveJoyG. Can you explain the different objects and methods or the different parts of the code? Is it Visual Basic? I have only basic knowledge in VBScript (ASP)...

I have realised that it is the internal clock of the pc that actually are running. If I return the Win-time in a cell, it shows the digits corresponding to the current time. And I can see the time running, showing up to 18 digits or more. (In other words; the prosessor-speed?)

I would like to use that in a VBScript (ASP-tech), but I guess it is a mutch more simple way to control time in VBScript?

Mvh
grstad
 
Old February 26th, 2007, 01:45 PM
Authorized User
 
Join Date: Sep 2006
Posts: 13
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I.m not sure I'm following your question.
When F9 is pressed, a new calculation is forced on the worksheet. The vb command for that is Calculate. Excel normally is defaulted to auto-calculation and will re-calculate the sheet anytime changes are made to affected formulas. I believe it is a worksheet change event that triggers this.
Not sure what you mean by the clock of the PC since time is not really involved. If you have =Now() in a cell then the time will refresh to the current system time each time F9 is pressed.
Are you looking to execute an event based on time?
You can use:
                Application.OnTime Now + TimeValue("00:00:15"), "my_Procedure"
or Application.OnTime TimeValue("17:00:00"), "my_Procedure"

Hope this helps...

DaveG





Similar Threads
Thread Thread Starter Forum Replies Last Post
Using key() and <xsl:key> freddy XSLT 2 January 18th, 2007 08:55 PM
<bean:message key="PNR.INPUT"/> key has null value warsha_14 Struts 1 November 13th, 2006 07:26 AM
TAB KEY working together KEY PRESS event thomaz C# 4 August 20th, 2006 02:47 PM
FOREIGN KEY and PRIMARY KEY Constraints junemo Oracle 10 June 15th, 2004 01:00 AM
program code for "save" (F9) command mario_fluegge Access 3 August 8th, 2003 04:50 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.