Results 1 to 16 of 16

Thread: I know, it will be a stupid question, however...

Threaded View

  1. #13
    Frenzied Member
    Join Date
    Jun 2006
    Posts
    1,098

    Re: I know, it will be a stupid question, however...

    Do you need to use Val? You may be able to use CDbl instead, but you'll need to make sure the string is numeric first.
    Code:
    If IsNumeric(Text1.Text) Then
      dblValue = CDbl(Text1.Text)
    Else
      dblValue = 0
    End If
    As a function: (Returns 0 if not numeric)
    Code:
    Public Function MyVal(Number As String) As Double
      If IsNumeric(Number) Then MyVal = CDbl(Number)
    End Function
    Last edited by Logophobic; Jun 12th, 2007 at 08:20 PM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width