PDA

View Full Version : Loop through cells values on each button click



jeffscpu
04-09-2008, 08:17 AM
I have a range of cells (t1:t116) that contain image numbers. I am trying to write code that says every time the button is clicked move to the next cell and display that image. ie: When the button is clicked the first time it shows image1 (value of cell t1) the second time it is clicked it shows image2 (value of cell t2) and so on... Here is my image code:

Sheet1.Image2.Picture = LoadPicture("\\fs1\RL Cards\Front\slide (" & [t1] & ").jpg")

I tried counting loops but it would loop through all of the images on the first click not after every click. I'm stumped...

Thanks!!!

RonMcK
04-09-2008, 09:12 AM
Please upload a copy of the file with the code that's not working for you?

Thanks,

mdmackillop
04-09-2008, 10:13 AM
Here's a photo utility (http://vbaexpress.com/kb/getarticle.php?kb_id=839) I made up a while ago.