LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5
Default error message: compile error, argument not optional

Hi,

I have a txt_box in a userform called txt_staf1 where the user can put in a
number for example 2,5 or 25,8.

I have the following code with the txt_box

Private Sub txt_staf1_Exit(ByVal Cancel As MSForms.ReturnBoolean)
OnlyNumbers
rekenen
End Sub

where 'rekenen' is a sub that makes the sheet recalculate.

I check if the input is a number using the sub OnlyNumbers:

Private Sub OnlyNumbers(ctl As Object)
With ctl
If Not IsNumeric(Left(.Value, 1)) And .Value < vbNullString Then
MsgBox "Sorry, alleen getallen toegestaan", vbOKOnly, "De Pensioen
Adviseur"
.Value = vbNullString
.SetFocus
End If
End With
End Sub

When the user puts in a number i get the error message: compile error,
argument not optional
Does anybody know what is wrong ?
thanks,
Jean-Pierre


--
Message posted via OfficeKB.com
http://www.officekb.com/Uwe/Forums.a...mming/200509/1
 
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
Compile Error Argument Not optional [email protected] Excel Discussion (Misc queries) 1 August 16th 06 04:58 PM
VBA Error Message "Compile Error...." Steve Excel Discussion (Misc queries) 3 July 15th 05 09:20 AM
Complie Error- Argument not optional Roberta Excel Programming 5 April 4th 05 02:31 PM
How do I get rid of "Compile error in hidden module" error message David Excel Discussion (Misc queries) 4 January 21st 05 11:39 PM
Error message:"Compile error modul 1" Jonsson[_39_] Excel Programming 1 July 16th 04 10:01 PM


All times are GMT +1. The time now is 01:46 AM.

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"