Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
pop-up calculator
how do I set up to click on cell and number pad shows up like ms money
|
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
pop-up calculator
The simplest way is to use code like the following in the module of the
worksheet that should intercept the DoubleClick event. Right click the sheet's tab and choose View Code. Paste the following code into that module. Change the "A1:A10" to the range that, when double-clicked, should bring up the calculator. Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As Boolean) If Not Application.Intersect(Me.Range("A1:A10"), Target) Is Nothing Then Cancel = True Shell "Calc.exe" End If End Sub With this code, the calculator will be obscured by the main Excel window. A better solution is to make the Calculator window a child of the main Excel window. With the following code, the calculator will float above the Excel worksheet windows. Private Declare Function FindWindow Lib "user32" Alias "FindWindowA" ( _ ByVal lpClassName As String, _ ByVal lpWindowName As String) As Long Private Declare Function SetParent Lib "user32" ( _ ByVal hWndChild As Long, _ ByVal hWndNewParent As Long) As Long Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As Boolean) Dim XLHWnd As Long Dim CalcHWnd As Long If Not Application.Intersect(Me.Range("A1:A10"), Target) Is Nothing Then Cancel = True Shell "Calc.exe" XLHWnd = Application.Hwnd CalcHWnd = FindWindow("SciCalc", "Calculator") If CalcHWnd < 0 Then SetParent CalcHWnd, XLHWnd End If End If End Sub -- Cordially, Chip Pearson Microsoft MVP - Excel, 10 Years Pearson Software Consulting www.cpearson.com (email on the web site) "Anthony" wrote in message ... how do I set up to click on cell and number pad shows up like ms money |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Integrated calculator in excel 07 instead of separate calculator | Excel Programming | |||
Calculator | Excel Discussion (Misc queries) | |||
calculator | Excel Discussion (Misc queries) | |||
calculator | Excel Discussion (Misc queries) | |||
Pop-up calculator? | Excel Programming |