+ Reply to Thread
Results 1 to 10 of 10

UserForm Frame

  1. #1
    Forum Contributor
    Join Date
    07-07-2017
    Location
    USA
    MS-Off Ver
    2010
    Posts
    500

    UserForm Frame

    Greetings,
    I have been struggling trying to figure out why the following code is not working. The code is inside the UserForm_Initialize.
    "fr_Chg_Mnth_2" is the Frame I am wanting to show/hide based on the following code. If cell DC4 on sheet8 contains text I want the Frame to show. If cell DC4 on sheet8 is empty I want the Frame to hide.
    Please Login or Register  to view this content.

  2. #2
    Forum Guru
    Join Date
    09-10-2017
    Location
    Chippenham, England
    MS-Off Ver
    365
    Posts
    15,784

    Re: UserForm Frame

    That code works fine for me.
    Are you sure that you are looking at the correct cell on the correct sheet?
    Also if you just want to hide a command button, why not just use the Visible property of the button, rather than put a frame over it?

  3. #3
    Forum Contributor
    Join Date
    07-07-2017
    Location
    USA
    MS-Off Ver
    2010
    Posts
    500

    Re: UserForm Frame

    Fluff13,
    Thank you for the recommendation. I figured out what the problem was, I was using a "Me.Hide" when closing the Userform instead of "Unload..."
    However, I am curious about using the "Visible property of the button.

  4. #4
    Forum Guru
    Join Date
    09-10-2017
    Location
    Chippenham, England
    MS-Off Ver
    365
    Posts
    15,784

    Re: UserForm Frame

    You can use something like this to "hide" the commanButton
    Please Login or Register  to view this content.

  5. #5
    Forum Contributor
    Join Date
    07-07-2017
    Location
    USA
    MS-Off Ver
    2010
    Posts
    500

    Re: UserForm Frame

    That is what I am using.
    Works now.

  6. #6
    Forum Guru
    Join Date
    09-10-2017
    Location
    Chippenham, England
    MS-Off Ver
    365
    Posts
    15,784

    Re: UserForm Frame

    You're welcome & thanks for the feedback

  7. #7
    Forum Guru
    Join Date
    04-23-2012
    Location
    New Jersey, USA
    MS-Off Ver
    Excel 365
    Posts
    2,466

    Re: UserForm Frame

    Quote Originally Posted by Fluff13 View Post
    You can use something like this to "hide" the commanButton
    Please Login or Register  to view this content.
    For those who might be interested, this can be compacted down to this single line of code...
    Please Login or Register  to view this content.

  8. #8
    Forum Contributor
    Join Date
    07-07-2017
    Location
    USA
    MS-Off Ver
    2010
    Posts
    500

    Re: UserForm Frame

    Rick,
    How would I make the CommandButton1 not Visible if DC4 has text. It shows now if the cell has text.

  9. #9
    Forum Guru
    Join Date
    04-23-2012
    Location
    New Jersey, USA
    MS-Off Ver
    Excel 365
    Posts
    2,466

    Re: UserForm Frame

    Quote Originally Posted by brentjohn View Post
    Rick,
    How would I make the CommandButton1 not Visible if DC4 has text. It shows now if the cell has text.
    That is backwards from what Fluff13 posted and which you said works. With that said, give this a try...

    Me.CommandButton1.Visible = Len(Sheet8.Range("DC4").Value) = 0
    Last edited by Rick Rothstein; 09-01-2019 at 05:10 PM.

  10. #10
    Forum Contributor
    Join Date
    07-07-2017
    Location
    USA
    MS-Off Ver
    2010
    Posts
    500

    Re: UserForm Frame

    Rick,
    Actually I have a few CommandButtons that are "backwards" in the code. However, your code works great!
    Thank you much!

+ 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] Remove 3D frame around userform
    By awc002 in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 10-07-2022, 01:06 PM
  2. Userform frame progress bar for userform completion
    By ABSTRAKTUS in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 01-12-2017, 11:20 AM
  3. [SOLVED] Clearing a frame on a userform
    By VBANovice46 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 09-06-2015, 07:31 AM
  4. [SOLVED] UserForm Frame Command Button
    By nicksyplonk in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 07-06-2015, 11:28 AM
  5. [SOLVED] Looping through controls by frame on userform (frame within a frame)
    By njs27 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 03-27-2015, 10:21 AM
  6. Get frame name in userform to input a certain cell
    By Nguyen Tien Long in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 06-01-2012, 07:08 AM
  7. UserForm with Frame - Problem
    By Fossil_Rock in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 07-28-2005, 09:49 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