Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
alsoHi ,
I'd like to build a calculator in Excel in a Userform as an addin. It should become a regular calculator with the normal buttons and a textbox as display. I already prepared the userform with the needed buttons such as : Back CE C MC 7 8 9 / MR 4 5 6 * MS 1 2 3 - M- 0 00 . + M+ 000 +/- I'm stuck with the code for capturing the numeric values and the allowed values. I know i should only allow the numkeys and a few others , but here i'm also stuck. Is it possible to write this in Excel , and if so , could you help me with the code ? |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
You probably need to use text boxes. Then you have to use Val("1") to read
the characters and convert to numerica values. Declaring variables as numeric types (long, single, double, float) will in some cases allow vba to automaticall do the conversions. You should also use ISNUMERIC to check if the boxes contain numeric values. Possibly disable the boxes so users don't type in characters only the softeare will be able to place numbers into the box when the keyboard is pressed. "Mario" wrote: alsoHi , I'd like to build a calculator in Excel in a Userform as an addin. It should become a regular calculator with the normal buttons and a textbox as display. I already prepared the userform with the needed buttons such as : Back CE C MC 7 8 9 / MR 4 5 6 * MS 1 2 3 - M- 0 00 . + M+ 000 +/- I'm stuck with the code for capturing the numeric values and the allowed values. I know i should only allow the numkeys and a few others , but here i'm also stuck. Is it possible to write this in Excel , and if so , could you help me with the code ? |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Reinventing the wheel?
Sub ShowCalc() Shell "Calc.exe", vbNormalFocus End Sub If it doesn't work try with the full path, eg Shell "C:\Windows\system32\Calc.exe", vbNormalFocus Regards, Peter T "Mario" wrote in message ... alsoHi , I'd like to build a calculator in Excel in a Userform as an addin. It should become a regular calculator with the normal buttons and a textbox as display. I already prepared the userform with the needed buttons such as : Back CE C MC 7 8 9 / MR 4 5 6 * MS 1 2 3 - M- 0 00 . + M+ 000 +/- I'm stuck with the code for capturing the numeric values and the allowed values. I know i should only allow the numkeys and a few others , but here i'm also stuck. Is it possible to write this in Excel , and if so , could you help me with the code ? |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Isn't that what Excel is for? Plus there's the Windows calculator already.
Is this just an excercise in coding? I found it easier to to use two text boxes, one to the rigth of the other, with the four maths function buttons vertically between them with text boxes, all you need to do is (1) trap the first letter isn't a decimal - if it is, prcede it with a zero, then(2) check if the text isnumeric "Mario" wrote: alsoHi , I'd like to build a calculator in Excel in a Userform as an addin. It should become a regular calculator with the normal buttons and a textbox as display. I already prepared the userform with the needed buttons such as : Back CE C MC 7 8 9 / MR 4 5 6 * MS 1 2 3 - M- 0 00 . + M+ 000 +/- I'm stuck with the code for capturing the numeric values and the allowed values. I know i should only allow the numkeys and a few others , but here i'm also stuck. Is it possible to write this in Excel , and if so , could you help me with the code ? |
#5
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Thanks for the respons.
to Joel : I'll try some things and let you know what happens. To Peter T: Yes I know , reinventing the wheel.! But i'll need to develop this calc for special uses. If i got it working correctly , i'll probably will be able to add features that are needed for some users. Thanks for helping me. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
how do i create a cd calculator | Excel Worksheet Functions | |||
I would like to create a payment calculator to use with excel | Excel Worksheet Functions | |||
Can I create a userform in Excel to create an appointment in Outlo | Excel Programming | |||
Integrated calculator in excel 07 instead of separate calculator | Excel Programming | |||
UserForm Calculator | Excel Programming |