Results 1 to 7 of 7

Write If/And statement for userform textboxes that are only visible

Threaded View

clemsoncooz Write If/And statement for... 02-14-2012, 06:18 PM
tigeravatar Re: Write If/And statement... 02-14-2012, 06:34 PM
clemsoncooz Re: Write If/And statement... 02-15-2012, 11:10 AM
Richard Buttrey Re: Write If/And statement... 02-14-2012, 06:37 PM
clemsoncooz Re: Write If/And statement... 02-15-2012, 10:32 AM
clemsoncooz Re: Write If/And statement... 02-15-2012, 10:49 AM
clemsoncooz Re: Write If/And statement... 02-15-2012, 10:33 AM
  1. #1
    Forum Contributor
    Join Date
    12-20-2011
    Location
    United States, Ohio
    MS-Off Ver
    Excel 2010
    Posts
    295

    Write If/And statement for userform textboxes that are only visible

    I am trying to write an "if + and" statement that is like the following. (This is all for a userform)

    Upon the user hitting the submit buttton:

    Sub cmdGO_click()
       If CheckBox1.Value = False And (only the visible textboxes that are blank)
             msgbox "warning"
    End Sub
    it ths only visible textboxes that are blank I am having trouble with and dont know how to code.

    Those textboxes that are named (and visible -which is dyanimic):
        For y = 1 To Me.tbxBuildingcount
            Me.Controls("Textbox" & y).Visible = True
            Me.Controls("Label" & y + 4).Visible = True
            Me.Controls("tbxSQFT" & y).Visible = True
            Me.Controls("lbSQFT" & y).Visible = True
        Next y
    and tbxBuildingcount is just a value from a spin button.


    I am just trying to error trap and make sure that the user has filled out every visible textbox and if they dont, then warn them that they do.
    The reason for the checkbox is that is it is true, then they can proceed. But if false, and some blank textboxes, they get this warning.

    Thanks in advance.
    Last edited by clemsoncooz; 02-15-2012 at 11:11 AM.

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