+ Reply to Thread
Results 1 to 17 of 17

quiz: selection of cells of interest on picture

  1. #1
    Registered User
    Join Date
    02-09-2017
    Location
    Beernem, Belgium
    MS-Off Ver
    7
    Posts
    11

    quiz: selection of cells of interest on picture

    Hi all,

    I will first try to explain the set-up of the quiz.
    One must click a button and a random picture is selected from a file. One picture displays two different cells: positive and negative. Only the positive cells need to be selected. At the end of the session, after clicking the button 'solution', the correctly selected positive cells are indicated in green and the non-selected positive cells are indicated in red.
    Is this possible using VBA?
    I already managed to randomly select the pictures clicking a button, but I have no clue on how to indicate the positive and negative cells...

    Thank you in advance,

    Kind regards,
    Veerle Bogaert

  2. #2
    Valued Forum Contributor ImranBhatti's Avatar
    Join Date
    03-27-2014
    Location
    Rawalpindi,Pakistan
    MS-Off Ver
    Office 365
    Posts
    1,784

    Re: quiz: selection of cells of interest on picture

    Upload a sample workbook with desired results manually shown. It seems a little project.
    Teach me Excel VBA

  3. #3
    Registered User
    Join Date
    02-09-2017
    Location
    Beernem, Belgium
    MS-Off Ver
    7
    Posts
    11

    Re: quiz: selection of cells of interest on picture

    Hi,

    The link for uploading the file doesn't seem to work... When I hit the button, I get a pale yellow rectangle.
    Is it ok that I give you the code and a picture of the expected results?

    Regards

  4. #4
    Registered User
    Join Date
    02-09-2017
    Location
    Beernem, Belgium
    MS-Off Ver
    7
    Posts
    11

    Re: quiz: selection of cells of interest on picture

    Hi,

    With the help of the administrator (Thank you very much!), I managed to attach the file.
    If you have any questions, please do not hesitate to contact me.

    Thanks!
    Attached Files Attached Files

  5. #5
    Valued Forum Contributor ImranBhatti's Avatar
    Join Date
    03-27-2014
    Location
    Rawalpindi,Pakistan
    MS-Off Ver
    Office 365
    Posts
    1,784

    Re: quiz: selection of cells of interest on picture

    I understood that clicking the "Click" the random pictures are displayed on the sheet.Now what do you mean by positive cells and negative cells?

    Where is the button "Solution" what should it do?

    All you need please try to explain graphically and manually.

  6. #6
    Registered User
    Join Date
    02-09-2017
    Location
    Beernem, Belgium
    MS-Off Ver
    7
    Posts
    11

    Re: quiz: selection of cells of interest on picture

    I have uploaded a pdf file explaining which cells are positive and which cells are negative.
    The user should be able to choose to click the cells on the photo he thinks is positive. An black oval should appear around the cell when selecting it.
    After hitting the 'solution' button (not added to the file yet), this oval should turn green when correctly selected.
    When positive cells were not selected by the user, a red oval should appear around the cell.
    Attached Files Attached Files

  7. #7
    Valued Forum Contributor kasan's Avatar
    Join Date
    07-22-2009
    Location
    Riga, Latvia
    MS-Off Ver
    Excel 2010
    Posts
    680

    Re: quiz: selection of cells of interest on picture

    One way to manage this type of test is edit all pictures and put numbers near all cells (1,2,3..) and then ask user to choose correct number (this way is much more easier to process answers & results). I have some ready solutions, posted somewhere on this forum.
    Other option could be UserForm. Load picture to UserForm and then create some elements above this picture - right over Cells. If user click on one of these elements - something happen. But in this case you should have positions of those elements for each picture (because cells on them can be enywhere). This is difficult way, but this can be closer to result you wish to get.

  8. #8
    Valued Forum Contributor kasan's Avatar
    Join Date
    07-22-2009
    Location
    Riga, Latvia
    MS-Off Ver
    Excel 2010
    Posts
    680

    Re: quiz: selection of cells of interest on picture

    Well, I've played around this and built up small Userform with some Image and Button elements.
    After you run the test you will see 3 pictures on a form, you can choose your answer by clicking on a picture - picked answers will highlighted with yellow background.
    If you changed your mind - you can click on already chosen (yellow) picture and your chose will be canceled.
    You can zoom each picture to look at it closer (quality of pictures are bad, but I'm just trying to tell you my idea). When you click on zoomed picture - it will be closed.
    After you are sure about your chose - press Solution button. Correct answers are 1 and 2 pictures, if you will choose different options - pictures will be highlighted.
    Once again - this is not completed solution, this is just demonstration of my idea how your task can be done.
    To make it work - you will need lot of pictures, think about random picture loading on a form, count correct answers and so on.
    Attached Files Attached Files

  9. #9
    Registered User
    Join Date
    02-09-2017
    Location
    Beernem, Belgium
    MS-Off Ver
    7
    Posts
    11

    Re: quiz: selection of cells of interest on picture

    Hi,

    Thank you very much for your help!
    So, the best way to go is to set up a userform for each picture?
    How can I add the ovals? The rotation of these ovals depends on the alignment of the cells.

    Regards

  10. #10
    Valued Forum Contributor kasan's Avatar
    Join Date
    07-22-2009
    Location
    Riga, Latvia
    MS-Off Ver
    Excel 2010
    Posts
    680

    Re: quiz: selection of cells of interest on picture

    Hi,
    I'm not tellin you that userform is the best way, just one of the possible ways. Your requriment seems quite complicate. You want to draw shapes on some existing picture, you also wish to draw those ovals rotated.
    Do you really need to load whole picture (with several cells on it)?
    If I got it right - you wish to make some solution where users could look at cells then choose positive cells and check if their choise was correct. I would suggest to think about different way to show cells (not on one picture).

  11. #11
    Registered User
    Join Date
    02-09-2017
    Location
    Beernem, Belgium
    MS-Off Ver
    7
    Posts
    11

    Re: quiz: selection of cells of interest on picture

    Hi,

    Thank you for the suggestions!
    We opt to work as you suggested. However, we would like to show overview pictures in which we indicate the cell of interest with an arrow. The reason why we choose to show overview pictures is because the relative size of the cells is important.
    Maybe we can show one picture at a time (randomly seleted). The user can then select to push either one of the two buttons "positve" and "negative". When correct, the background turns green. Otherwise, it turns red.
    Is this possible?

    Regards
    Last edited by vbogaert; 02-14-2017 at 09:21 AM.

  12. #12
    Valued Forum Contributor kasan's Avatar
    Join Date
    07-22-2009
    Location
    Riga, Latvia
    MS-Off Ver
    Excel 2010
    Posts
    680

    Re: quiz: selection of cells of interest on picture

    One picture and two buttons under: "positive" and "negative". This is possible.
    But you wrote in post #1 "One picture displays two different cells: positive and negative". How to check correct answer? If one picture contains 2 positive and 1 negative cell? I click "positive".. is this correct?
    If whole picture is important then may be we can display one big picture (with all cells) and under this picture show smaller pictures of cells only? This way you can see all cells together and select positive cells from smaller pictures?
    cells.jpg

  13. #13
    Registered User
    Join Date
    02-09-2017
    Location
    Beernem, Belgium
    MS-Off Ver
    7
    Posts
    11

    Re: quiz: selection of cells of interest on picture

    Hi kasan,

    The cell of interest on the picture could be indicated with an arrow. Only one cell can be assessed per picture.

    However, your idea is better. Does this mean that for every picture, I should first save different 'sub-pictures' on the hard disk?

    Regards

  14. #14
    Valued Forum Contributor kasan's Avatar
    Join Date
    07-22-2009
    Location
    Riga, Latvia
    MS-Off Ver
    Excel 2010
    Posts
    680

    Re: quiz: selection of cells of interest on picture

    Yes, you should cut "sub-pictures" and save them as separate files.
    Just give some reasonable names for files to access them easy. I would use numbers as reference between big pic and sub-pictures.
    Like this:
    Pic_big_1
    Pic_cell_11
    Pic_cell_12
    ...
    Pic_big_2
    Pic_cell_21
    Pic_cell_22
    ...

  15. #15
    Registered User
    Join Date
    02-09-2017
    Location
    Beernem, Belgium
    MS-Off Ver
    7
    Posts
    11

    Re: quiz: selection of cells of interest on picture

    Hi,

    I have written a code for the project I described in my first post.
    I can across a problem. I want to transfer variables from a private sub (commandbutton click) to another private sub (another commandbutton click).
    After checking out some options, I don't seem to find to solution.
    Does one of you have any suggestions?

    Thanks!


    Please Login or Register  to view this content.
    Attached Files Attached Files
    Last edited by vbogaert; 05-30-2017 at 08:04 AM.

  16. #16
    Forum Guru
    Join Date
    03-02-2006
    Location
    Los Angeles, Ca
    MS-Off Ver
    WinXP/MSO2007;Win10/MSO2016
    Posts
    12,643

    Re: quiz: selection of cells of interest on picture

    Variables declared with Dim at the module level are available to all procedures within the module
    Please Login or Register  to view this content.
    Ben Van Johnson

  17. #17
    Registered User
    Join Date
    02-09-2017
    Location
    Beernem, Belgium
    MS-Off Ver
    7
    Posts
    11

    Re: quiz: selection of cells of interest on picture

    many thanks!

+ 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. Display Vendor Details And Picture on Product Selection
    By MdYas in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 11-26-2015, 08:00 AM
  2. Selection problem to resize picture
    By vismbr in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 03-15-2013, 12:01 PM
  3. Show picture upon selection
    By ufopilot3 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 07-23-2012, 07:05 AM
  4. Insertion of picture by xls formula/ naming the picture with multiple selection crite
    By luckiest man in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 06-18-2011, 12:11 AM
  5. Picture quiz
    By BaronMoon in forum Excel General
    Replies: 2
    Last Post: 12-27-2010, 09:28 PM
  6. How to convert a selection to a picture
    By Edgar Cuellar in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 04-06-2006, 12:10 PM
  7. Insert Picture from dropdown selection
    By Mike at Channel in forum Excel - New Users/Basics
    Replies: 21
    Last Post: 03-21-2006, 09:15 PM

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