Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 31
Default validating input in textbox

Hi,

My spreadsheet consists of a numer of sheets:
1. input data from the user
2. a sheet where i make my calculations based on the input of the user
3. help file in which additional dat is stored, needed for the calculations

I would like to construct an application where you don't see excel anymore.
I don't know if this is possible but i started anyway to see if it can be
done.

I have a few questions:

I made the application so that excel disappers (and appears again on closing)
The only thing you see is the multipage userform i constructed (4 pages)
most pages are used to get a sort of flow of information (step 1-4) and on
one page i put an excel sheet where the user can input a database of persons
which i need for the calculations.

Q1. Do i still need excell to make the difficult calculations ore can i let
vba do the calculation for each databasemember and get the total on a
differen page of the userform ? after vba calculated each single memeber of
the database, i want the total...

Q2. How can i access the data in the spreadsheet on the page in the
multipageform ?

Q3 I have a multipage userform on which the user can input various items in
combo's text boxes etc.
in one particular instance I want the input in a textbox to always be an
number (numeric value) and i wrote the following code:

Private Sub hui_eb_hoofd_change()
OnlyNumbers
End Sub

Private Sub OnlyNumbers()
With Me.ActiveControl
If Not IsNumeric(.Value) And .Value < vbNullString Then
MsgBox "Sorry, alleen getallen toegestaan"
.Value = vbNullString
End If
End With
End Sub

Nothing happens when i enter text instead of numbers. Did i construct the
code wrong or did i place it in the wrong part of the project (i put in in
the form's VBA)? i don't know...anybody?

By the way, i'am looking also for a way to make sure thereis a dat entered
(dd:mm:yyyy) and a way to make sure a percentage is put in with 2 decimals....


I know, a lot of questions but i' am still a novice...but learning fast...
hopefully.
thanks for your help guys !
Jean-Pierre


--
Message posted via http://www.officekb.com
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,327
Default validating input in textbox

Hi Jean Pierre

Q3 only: Use this code for your textbox and only positive integers can be
typed into it:

Private Sub TextBox1_KeyDown(ByVal KeyCode As _
MSForms.ReturnInteger, ByVal Shift As Integer)
If KeyCode = 86 Then KeyCode = 0
End Sub

Private Sub TextBox1_KeyPress(ByVal KeyAscii As _
MSForms.ReturnInteger)
Select Case KeyAscii
Case 48 To 57
Case Else
KeyAscii = 0
End Select
End Sub

HTH. Best wishes Harald


"Jean-Pierre D via OfficeKB.com" skrev i melding
...
Hi,

My spreadsheet consists of a numer of sheets:
1. input data from the user
2. a sheet where i make my calculations based on the input of the user
3. help file in which additional dat is stored, needed for the

calculations

I would like to construct an application where you don't see excel

anymore.
I don't know if this is possible but i started anyway to see if it can be
done.

I have a few questions:

I made the application so that excel disappers (and appears again on

closing)
The only thing you see is the multipage userform i constructed (4 pages)
most pages are used to get a sort of flow of information (step 1-4) and on
one page i put an excel sheet where the user can input a database of

persons
which i need for the calculations.

Q1. Do i still need excell to make the difficult calculations ore can i

let
vba do the calculation for each databasemember and get the total on a
differen page of the userform ? after vba calculated each single memeber

of
the database, i want the total...

Q2. How can i access the data in the spreadsheet on the page in the
multipageform ?

Q3 I have a multipage userform on which the user can input various items

in
combo's text boxes etc.
in one particular instance I want the input in a textbox to always be an
number (numeric value) and i wrote the following code:

Private Sub hui_eb_hoofd_change()
OnlyNumbers
End Sub

Private Sub OnlyNumbers()
With Me.ActiveControl
If Not IsNumeric(.Value) And .Value < vbNullString Then
MsgBox "Sorry, alleen getallen toegestaan"
.Value = vbNullString
End If
End With
End Sub

Nothing happens when i enter text instead of numbers. Did i construct the
code wrong or did i place it in the wrong part of the project (i put in in
the form's VBA)? i don't know...anybody?

By the way, i'am looking also for a way to make sure thereis a dat entered
(dd:mm:yyyy) and a way to make sure a percentage is put in with 2

decimals....


I know, a lot of questions but i' am still a novice...but learning fast...
hopefully.
thanks for your help guys !
Jean-Pierre


--
Message posted via http://www.officekb.com



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
Excel VBA - Cursor disappears when validating content of a TextBox lonewolfbr Excel Programming 0 September 16th 04 09:49 PM
validation of input in textbox Peer Excel Programming 3 July 23rd 04 03:06 PM
Validating Entry into Textbox Brad[_11_] Excel Programming 1 December 4th 03 02:58 PM
Limit input in a textbox James Agostinho Excel Programming 2 September 10th 03 03:10 PM
Validating user input to a listbox Stuart[_5_] Excel Programming 3 September 6th 03 07:32 AM


All times are GMT +1. The time now is 01:12 PM.

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"