View Single Post
  #2   Report Post  
Jim Cone
 
Posts: n/a
Default

From the VBA help file...

'This example uses the Shell function to run the Calculator application
'included with Microsoft Windows.
'It uses the SendKeys statement to send keystrokes to add some numbers,
'and then quit the Calculator.
'The SendKeys statement is not available on the Macintosh.
'(To see the example, paste it into a procedure, then run the procedure.
'Because AppActivate changes the focus to the Calculator application,
'you can't single step through the code.)

Sub Demo()

Dim ReturnValue, I
ReturnValue = Shell("CALC.EXE", 1) ' Run Calculator.
AppActivate ReturnValue ' Activate the Calculator.
For I = 1 To 100 ' Set up counting loop.
SendKeys I & "{+}", True ' Send keystrokes to Calculator
Next I ' to add each value of I.
SendKeys "=", True ' Get grand total.
SendKeys "%{F4}", True ' Send ALT+F4 to close Calculator.

End Sub

Jim Cone
San Francisco, USA



"fedthecat" wrote in message
...
There is a way to cause a small calculator to appear when you click on a
spreadsheet cell. How do I activate this feature? I can not find it anywhere
and can find no info on it.