Results 1 to 7 of 7

Simple add Format Numeric value in Function

Threaded View

  1. #1
    Forum Contributor onmyway's Avatar
    Join Date
    09-03-2012
    Location
    Johannesburg, South Africa
    MS-Off Ver
    2013
    Posts
    386

    Simple add Format Numeric value in Function

    Hi guys,

    I need some help adding a line to my Function that will Format the numeric field as follows: "#,##0.00"

    My function code:

    'FUNCTION
    Function IsInvalid(ctl As MSForms.Control) As Boolean
    
        If Len(ctl.Value) = 0 Then
            MsgBox "Please enter a value"
            IsInvalid = True
            
        ElseIf Not IsNumeric(ctl.Value) Then
            MsgBox "Sorry, only numbers allowed"
            ctl.Value = vbNullString
    
            IsInvalid = True
          
        End If
    
    End Function
    
    
    Private Sub txtConsumables1_Exit(ByVal Cancel As MSForms.ReturnBoolean)
    Cancel = IsInvalid(txtConsumables1)
    End Sub
    Thank you!
    Last edited by onmyway; 01-30-2015 at 11:53 AM.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Simple alpha/numeric find feature similar to CTRL F
    By motecben in forum Excel General
    Replies: 2
    Last Post: 05-22-2013, 03:22 AM
  2. [SOLVED] How do I display numbers as simple (non-numeric) text?
    By Bastette in forum Excel - New Users/Basics
    Replies: 4
    Last Post: 10-16-2012, 09:05 PM
  3. Using the IF function with non-numeric digits & with numeric consequences
    By oldmillbill in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 10-08-2012, 02:39 PM
  4. Change number (in text format) to numeric format
    By Pam in forum Excel General
    Replies: 5
    Last Post: 10-24-2005, 03:05 PM
  5. [SOLVED] numeric format
    By Rocket J Squirrel in forum Excel General
    Replies: 2
    Last Post: 05-26-2005, 05:15 PM

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1