+ Reply to Thread
Results 1 to 4 of 4

USER FORM VBA to capture numeric

  1. #1
    Registered User
    Join Date
    09-16-2017
    Location
    Agra
    MS-Off Ver
    2013
    Posts
    72

    USER FORM VBA to capture numeric

    Hi All,

    Please advice. while I know a bit of VBA coding, I am working on USERFORM for first time ( just to let you know where am I )

    In the user form , I have captured a value Article code which should be numeric and mandatory.

    currently my when I checked my textbox1.value ( my articlecode field) , it is capturing numbers as text. For eg. 45 is appearing as "45".

    I want to perform validation that it should only expect numbers and not blank

    Please advice.

    Regards
    Ravi

  2. #2
    Forum Expert mikerickson's Avatar
    Join Date
    03-30-2007
    Location
    Davis CA
    MS-Off Ver
    Excel 2011
    Posts
    6,229

    Re: USER FORM VBA to capture numeric

    All entries in a textbox are strings.
    What you need to do is test if the string is a numeral (i.e. if it represents a number)
    Something like
    Please Login or Register  to view this content.
    _
    ...How to Cross-post politely...
    ..Wrap code by selecting the code and clicking the # or read this. Thank you.

  3. #3
    Forum Expert sintek's Avatar
    Join Date
    12-04-2015
    Location
    Cape Town
    MS-Off Ver
    2013 | 2016 | 2019
    Posts
    13,122

    Re: USER FORM VBA to capture numeric

    Perhaps an oversight...
    Please Login or Register  to view this content.
    Good Luck
    I don't presume to know what I am doing, however, just like you, I too started somewhere...
    One-day, One-problem at a time!!!
    If you feel I have helped, please click on the star to left of post [Add Reputation]
    Also....add a comment if you like!!!!
    And remember...Mark Thread as Solved.
    Excel Forum Rocks!!!

  4. #4
    Registered User
    Join Date
    09-16-2017
    Location
    Agra
    MS-Off Ver
    2013
    Posts
    72

    Re: USER FORM VBA to capture numeric

    Thanks all for Ur help. Much appreciated.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. [SOLVED] Capture changes to User Form selections when compared to initial inputs
    By jprlimey in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 07-22-2014, 05:23 PM
  2. [SOLVED] Capture Option Button selections on user form
    By jprlimey in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 07-22-2014, 11:41 AM
  3. Capture Data From User Form to Excel
    By ravidhiman in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 07-06-2014, 12:05 PM
  4. [SOLVED] User Form to execute search and return all values to the user form for editing
    By allwrighty in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 05-11-2013, 10:40 PM
  5. VB Code to Capture Data from User Form
    By rizmomin in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 12-17-2012, 12:33 PM
  6. User form text box Numeric Format?
    By nighttrainrex in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 10-11-2011, 09:02 PM
  7. Replies: 4
    Last Post: 02-06-2006, 03:05 AM

Tags for this Thread

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