Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 275
Default pop-up calculator

how do I set up to click on cell and number pad shows up like ms money
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7,247
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Integrated calculator in excel 07 instead of separate calculator Wayne Excel Programming 1 July 26th 06 04:16 PM
Calculator Terry Excel Discussion (Misc queries) 12 October 7th 05 10:54 AM
calculator Colin2u Excel Discussion (Misc queries) 4 August 20th 05 02:08 PM
calculator Colin2u Excel Discussion (Misc queries) 5 August 19th 05 09:13 PM
Pop-up calculator? 43fan Excel Programming 4 July 22nd 04 12:03 AM


All times are GMT +1. The time now is 07:36 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"