+ Reply to Thread
Results 1 to 6 of 6

Hide Textbox1 off if then condition

  1. #1
    Forum Contributor
    Join Date
    10-03-2012
    Location
    USA
    MS-Off Ver
    2010
    Posts
    496

    Hide Textbox1 off if then condition

    hello,
    I need a VBA to hide a textbox 1 pending on the below condition.
    if A1 = "Wrong Entry", texbox1 is unhiden
    if A1 = ""; textbox is hideden

    A1 has a formula, = if(B1<>"data", "wrong entry","") to check B1 = data

    Thanks
    Last edited by Rocky2013; 10-13-2018 at 01:25 PM.

  2. #2
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS 365 Family 64-bit 2404
    Posts
    24,754

    Re: Hide Textbox1 off if then condition

    This code goes into the worksheet module. I assume TextBox1 is an ActiveX textbox.

    Please Login or Register  to view this content.
    Jeff
    | | |·| |·| |·| |·| | |:| | |·| |·|
    Read the rules
    Use code tags to [code]enclose your code![/code]

  3. #3
    Forum Contributor
    Join Date
    10-03-2012
    Location
    USA
    MS-Off Ver
    2010
    Posts
    496

    Re: Hide Textbox1 off if then condition

    Hi,
    Popup error message "Run-time error '424' object required.
    Textbox 1 does not hide when A1="". I change the name to Textbox1 (without a space), same error.

    Thanks
    Attached Files Attached Files

  4. #4
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS 365 Family 64-bit 2404
    Posts
    24,754

    Re: Hide Textbox1 off if then condition

    Unfortunately there are three kinds of objects that Excel calls "textbox". I assumed it was an ActiveX textbox but your object is a drawing object textbox.

    The correct code for the file you attached is
    Please Login or Register  to view this content.

  5. #5
    Forum Contributor
    Join Date
    10-03-2012
    Location
    USA
    MS-Off Ver
    2010
    Posts
    496

    Re: Hide Textbox1 off if then condition

    It works now. Thanks

  6. #6
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS 365 Family 64-bit 2404
    Posts
    24,754

    Re: Hide Textbox1 off if then condition

    You're welcome! Thanks for the rep, and thanks for marking your thread Solved!

+ 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. If textbox1 is empty then put paste some default text to textbox1
    By vijaynadiad in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 06-19-2013, 03:16 PM
  2. hide columns on condition
    By Forestfall in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 08-05-2010, 04:26 PM
  3. [SOLVED] How do I hide a combo_box on a condition?
    By spannerj in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-06-2005, 12:05 PM
  4. [SOLVED] How do I hide a combo_box on a condition?
    By spannerj in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-06-2005, 10:05 AM
  5. How do I hide a combo_box on a condition?
    By spannerj in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-06-2005, 04:05 AM
  6. [SOLVED] How do I hide a combo_box on a condition?
    By spannerj in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-06-2005, 03:05 AM
  7. [SOLVED] How do I hide a combo_box on a condition?
    By spannerj in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-05-2005, 11:05 PM
  8. Hide Columns On Condition
    By Dominique Feteau in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 01-22-2005, 05:09 AM

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