+ Reply to Thread
Results 1 to 4 of 4

IsBlank in VBA

  1. #1
    Forum Contributor
    Join Date
    09-02-2005
    Posts
    146

    IsBlank in VBA

    Trying to design a check that makes a user insert an integer between 0 and 90.

    So far I can use this:
    Please Login or Register  to view this content.
    to force a numeric value between 0 and 90.

    The problem with that code is if the user has a value of "0" in the textbox and hit's backspace it triggers "Only numeric entries allowed", so I need to do something like:
    Please Login or Register  to view this content.
    But it would seem that isblank is not a native VBA function. I also can't access it if I use worksheetfunction.isblank(). What gives?

    The final question is how do I check to make sure an integer is sent in instead of a float (single)? I imagine there should be a function like IsInteger?
    Last edited by wilro85; 08-28-2009 at 06:26 PM.

  2. #2
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,258

    Re: IsBlank in VBA

    Hello wilro85,

    You don't the IsBlank method to validate the Text Box entry. All text box entries are text. Just test if the text box value is an empty string "".
    Please Login or Register  to view this content.
    Sincerely,
    Leith Ross

    Remember To Do the Following....

    1. Use code tags. Place [CODE] before the first line of code and [/CODE] after the last line of code.
    2. Thank those who have helped you by clicking the Star below the post.
    3. Please mark your post [SOLVED] if it has been answered satisfactorily.


    Old Scottish Proverb...
    Luathaid gu deanamh maille! (Rushing causes delays!)

  3. #3
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200

    Re: IsBlank in VBA

    You can also use the Len Function
    Please Login or Register  to view this content.
    Hope that helps.

    RoyUK
    --------
    For Excel Tips & Solutions, free examples and tutorials why not check out my web site

    Free DataBaseForm example

  4. #4
    Forum Contributor
    Join Date
    09-02-2005
    Posts
    146

    Re: IsBlank in VBA

    Figured it out.

    Please Login or Register  to view this content.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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