Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default Create userform calculator in Excel

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9,101
Default Create userform calculator in Excel

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,600
Default Create userform calculator in Excel

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,298
Default Create userform calculator in Excel

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default Create userform calculator in Excel

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
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
how do i create a cd calculator julie410 Excel Worksheet Functions 3 August 11th 08 02:00 AM
I would like to create a payment calculator to use with excel Frank Riley Excel Worksheet Functions 0 March 19th 08 06:37 PM
Can I create a userform in Excel to create an appointment in Outlo Spike4 Excel Programming 1 December 18th 06 09:44 AM
Integrated calculator in excel 07 instead of separate calculator Wayne Excel Programming 1 July 26th 06 04:16 PM
UserForm Calculator Tom Ogilvy Excel Programming 0 September 10th 03 05:52 PM


All times are GMT +1. The time now is 04:08 PM.

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

About Us

"It's about Microsoft Excel"