+ Reply to Thread
Results 1 to 4 of 4

Looping through controls by frame on userform (frame within a frame)

  1. #1
    Registered User
    Join Date
    08-12-2013
    Location
    USA
    MS-Off Ver
    Excel 2016, 32-bit
    Posts
    92

    Question Looping through controls by frame on userform (frame within a frame)

    Hi all!

    Thanks for the help the other day.

    So I have this form:
    framesIssue (2).jpgwhere I'm trying to loop through the controls frame by frame to capture the values the user has chosen. I have added the name for each frame to the picture so it is easier to follow the code. The problem is that when it gets to the "Timeframe" frame, which is a frame around both the Fiscal Year and Quarter of the year choices, it gives me a type mismatch error. I think this is because they are embedded frames? Like, it thinks it should be looking for "fr2" and it encounters frTimeframe and doesn't know what to do? I thought that by naming it "frTimeframe", Excel would ignore that frame and just go to the next one. It loops through the first frame with no problem and writes the correct data to the worksheet (this is obviously a snippet of the code). Can anyone help?

    Please Login or Register  to view this content.
    Thanks!!
    -njs

  2. #2
    Forum Expert gmr4evr1's Avatar
    Join Date
    11-24-2014
    Location
    Texas
    MS-Off Ver
    Office 2010 and 2007
    Posts
    3,448

    Re: Looping through controls by frame on userform (frame within a frame)

    I may be wrong, but I think it has to do with the
    Please Login or Register  to view this content.
    You've defined the fr 1 through 4, but not the frTimeFrame and the
    Please Login or Register  to view this content.
    is telling it to look for anything with fr & xitem (in this case 1 to 4) after it. frTimeFrame meets the 1st part of the criteria, but not the 2nd so it doesn't know what to do with it. Try taking the fr off the frTimeFrame and see what happens.
    Last edited by gmr4evr1; 03-26-2015 at 07:06 PM. Reason: Correct typo
    1N73LL1G3NC3 15 7H3 4B1L17Y 70 4D4P7 70 CH4NG3 - 573PH3N H4WK1NG
    You don't have to add Rep if I have helped you out (but it would be nice), but please mark the thread as SOLVED if your issue is resolved.

    Tom

  3. #3
    Registered User
    Join Date
    08-12-2013
    Location
    USA
    MS-Off Ver
    Excel 2016, 32-bit
    Posts
    92

    Re: Looping through controls by frame on userform (frame within a frame)

    Thanks! It worked! (although I don't really understand why it doesn't skip over it since it doesn't follow the format, but I'll just go with it)

  4. #4
    Forum Expert gmr4evr1's Avatar
    Join Date
    11-24-2014
    Location
    Texas
    MS-Off Ver
    Office 2010 and 2007
    Posts
    3,448

    Re: Looping through controls by frame on userform (frame within a frame)

    You are welcome, glad it worked. Basically it comes down to if the xitem is 1, 2, 3, or 4 after the "fr", it knows exactly what to do. Anything else after "fr" hasn't been defined, so it has no clue what to do with it and errors. It doesn't skip over it because there is nothing in the code to tell it to ignore it if it isn't fr & xitem

+ 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] userForm -> Frame 'top' value limited. Dynamically created controls,
    By kropeck in forum Excel Programming / VBA / Macros
    Replies: 29
    Last Post: 08-19-2013, 09:04 AM
  2. displaying a frame that is behind/embedded with another frame
    By bhodge10 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 11-02-2007, 10:23 AM
  3. [SOLVED] Controls in a Frame
    By JIPS in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 05-02-2006, 04:40 PM
  4. How to attach legend frame to chart frame?
    By holg3r in forum Excel Charting & Pivots
    Replies: 2
    Last Post: 07-07-2005, 06:41 PM
  5. Creating Userform Controls on Frame
    By David Myle in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 02-14-2005, 11:06 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