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 ?
|