PDA

View Full Version : Creating and displaying 16 frames on a userform each frame two labels.



josaah
09-20-2016, 08:00 AM
i would like to create 16 frames on a userform, each frame containing two labels. each frame and the labels will be randomly assigned to one of the cells in a 4x4 cell range. the userform will display one frame and its contents at a time when the correct name of the frame is provided in the cell it is assigned to and a "SUBMIT" button in the excel page is pressed.

mikerickson
09-21-2016, 07:49 AM
Can you attach a workbook with your layout and the desired results?

mikerickson
09-21-2016, 05:30 PM
I'm a bit curious about the intended user interaction.

Since this was posted in the Mac sub-forum, I'm assuming that you are using a Mac and don't have modless user forms available.

It sounds like you have a sheet with a 4X4 designated range (H1:K4 for this example)

You also have a user form with 16 frames.

You want to randomly assign each frame to one of those cells (but not put the frame name in the cells)

On the worksheet, you have a SUBMIT button.

The user will type names of frames into the 16 cells and press SUBMIT.
The Userform will appear.
Only those frames that have been correctly matched with their (randomly assigned) cells will be shown.

Am I correct so far?

In any case, it sounds like you will also need a START button on the sheet, so that the "randomly assign frames with cells" can be run.

(This almost sounds like a simulation for a Big Brother competition. (No spoilers, I haven't seen the finale yet) :) )

josaah
09-22-2016, 12:38 PM
I'm a bit curious about the intended user interaction.

Since this was posted in the Mac sub-forum, I'm assuming that you are using a Mac and don't have modless user forms available.

It sounds like you have a sheet with a 4X4 designated range (H1:K4 for this example)

***You also have a user form with 16 frames.

You want to randomly assign each frame to one of those cells (but not put the frame name in the cells)

On the worksheet, you have a SUBMIT button.

The user will type names of frames into the 16 cells and press SUBMIT.
The Userform will appear.
Only those frames that have been correctly matched with their (randomly assigned) cells will be shown.

Am I correct so far?

In any case, it sounds like you will also need a START button on the sheet, so that the "randomly assign frames with cells" can be run.

(This almost sounds like a simulation for a Big Brother competition. (No spoilers, I haven't seen the finale yet) :) )

Josaah

You're right.
***Each entry may be made and submitted so that the corresponding frame appears (in which case the next one replaces the first one so that at any given time only one frame is present [that is my original plan]). But it is also possible that the 16 frames will all be placed on the frame to appear one after the other and remain until all of them appear.

i have been trying to work on this project and i hereby present what i have so far done. but i want to write everything in VBA code from scratch considering the number of frames i have to deal with.

i could have worked the project out if i could handle the frames but piling 16 frames one on the other and working with them was difficult.

coding it will reduce the workload.

run from the developer code to see how it will appear

mikerickson
09-22-2016, 05:20 PM
I'm confused about a few things.

1) I still don't understand what the user interface will be. the "one at a time" thing puzzles me.
2) You are posting in the Mac forum, but your code uses windows file path separators, /, rather than Mac's :
3) It sounds like you have LoadPicuture working, which doesn't happen with Mac's.

Rather than making controls at run-time, it would be best if you just set up one frame and its internal controls so that its working and looking the way that you want to. Then select that frame and use the VBEditor Copy and paste feature to make 15 duplicates of it.

I'm also thinking that if you were to make a frame and its associated controls a custom object (class module) you could add Properties that would make handling those frames easier.

mikerickson
09-22-2016, 05:22 PM
I'm going to move this thread to the general Excel section.
LoadPicture does not work on Macs, and it appears that that will be a big feature of your user form, so I'll put this where people can help you.

josaah
09-22-2016, 05:47 PM
I'm going to move this thread to the general Excel section.
LoadPicture does not work on Macs, and it appears that that will be a big feature of your user form, so I'll put this where people can help you.

Josaah
This work is for windows excel so moving it to the appropriate forum will help a lot. Thanks