I have a revision question bank on Excel. Two of these questions (160 & 161) have accompanying pictures, that I want to appear if either question is randomly selected.
These images have filenames 160.jpg and 161.jpg respectively, and are in a folder on my Desktop called "FRT images". My randomly selected question number is in Cells(2,8). Here is my attempt (that doesn't work):
If Cells(2, 8) > 159 Then Qpic = "C:\WINDOWS\Des ktop\FRT images\" & Cells(2, 8)
...the idea being that if the randomly selected question (out of Q1 to Q161) is 160 or 161 (the only two currently with pictures), then in the image box called "Qpic" (set up from the control toolbar) will appear 160.jpg or 161.jpg as required. It doesn't work; the image box remains blank when these questions are selected.
I will also need to add in a further bit to select a blank image for the other questions, in order to blank out the pictures where no image is required. Any help?
These images have filenames 160.jpg and 161.jpg respectively, and are in a folder on my Desktop called "FRT images". My randomly selected question number is in Cells(2,8). Here is my attempt (that doesn't work):
If Cells(2, 8) > 159 Then Qpic = "C:\WINDOWS\Des ktop\FRT images\" & Cells(2, 8)
...the idea being that if the randomly selected question (out of Q1 to Q161) is 160 or 161 (the only two currently with pictures), then in the image box called "Qpic" (set up from the control toolbar) will appear 160.jpg or 161.jpg as required. It doesn't work; the image box remains blank when these questions are selected.
I will also need to add in a further bit to select a blank image for the other questions, in order to blank out the pictures where no image is required. Any help?
Comment