+ Reply to Thread
Results 1 to 7 of 7

Checking for empty textbox and setfocus the empty textbox

  1. #1
    Forum Contributor
    Join Date
    08-24-2012
    Location
    Hollidaysburg, Pa
    MS-Off Ver
    Excel 2010
    Posts
    398

    Checking for empty textbox and setfocus the empty textbox

    Want the command button to check if any of the many textboxes in a userform are empty.

    If empty, Want the macro to
    • setfocus on that textbox
    • Message box (pls enter the value)

    tried this

    Please Login or Register  to view this content.
    Problem :

    Doesn't setfocus the empty textbox
    Last edited by subbby; 05-23-2013 at 02:50 PM. Reason: Solved

  2. #2
    Forum Expert
    Join Date
    12-15-2009
    Location
    Chicago, IL
    MS-Off Ver
    Microsoft Office 365
    Posts
    3,177

    Re: Checking for empty textbox and setfocus the empty textbox

    Can you post your file.

  3. #3
    Forum Contributor
    Join Date
    08-24-2012
    Location
    Hollidaysburg, Pa
    MS-Off Ver
    Excel 2010
    Posts
    398

    Re: Checking for empty textbox and setfocus the empty textbox

    Quote Originally Posted by JieJenn View Post
    Can you post your file.
    Pls find it attached.

    Thanks
    Attached Files Attached Files

  4. #4
    Forum Expert
    Join Date
    12-15-2009
    Location
    Chicago, IL
    MS-Off Ver
    Microsoft Office 365
    Posts
    3,177

    Re: Checking for empty textbox and setfocus the empty textbox

    Change your code to

    Please Login or Register  to view this content.

  5. #5
    Forum Contributor
    Join Date
    08-24-2012
    Location
    Hollidaysburg, Pa
    MS-Off Ver
    Excel 2010
    Posts
    398

    Re: Checking for empty textbox and setfocus the empty textbox

    I have many textboxes. In the actual spreadsheet, I have too many textboxes and I cant individually check as per your approach .

    is there a way to check all and the setfocus on the first one it comes across and which is empty ?

  6. #6
    Forum Expert
    Join Date
    12-15-2009
    Location
    Chicago, IL
    MS-Off Ver
    Microsoft Office 365
    Posts
    3,177

    Re: Checking for empty textbox and setfocus the empty textbox

    Try this then

    Please Login or Register  to view this content.

  7. #7
    Forum Contributor
    Join Date
    08-24-2012
    Location
    Hollidaysburg, Pa
    MS-Off Ver
    Excel 2010
    Posts
    398

    Re: Checking for empty textbox and setfocus the empty textbox

    So its a COMBO BOX... not a textbox....

    Thank you very much for your help. that worked

+ 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