Results 1 to 4 of 4

Change image using scroll bar

Threaded View

  1. #1
    Registered User
    Join Date
    01-28-2012
    Location
    Buffalo, NY
    MS-Off Ver
    Excel 2011
    Posts
    3

    Change image using scroll bar

    I would like to be able to change the image in an excel file based on the value that is generated from a form scroll bar.

    Specifically, I have 100 images that I want to correspond to numbers 1-100 in a cell. I know how to display the value of the scroll bar on to a specific cell but I cannot make it so the image automatically updates as the values in scroll bar change.

    I would like the minute I change from two adjacent values (e.g. 49 to 50) for the image to automatically refresh.

    I have been trying to do this by loading the images from a folder on an active x image box with the following VBA code:

    Private Sub Worksheet_Change(ByVal Target As Range) 
        If Target <> Range("A1") Then Exit Sub 
        Select Case Target 
        Case "#1": Image1.Picture = LoadPicture("c:\images\1.bmp") 
        Case "#2": Image1.Picture = LoadPicture("c:\images\2.bmp") 
        Case "#3": Image1.Picture = LoadPicture("c:\images\3.bmp") 
        End Select 
    End Sub
    The images change when I manually type in and enter a new value in excel, but i would like the image to change as I scroll the scroll bar.

    Any input would be greatly appreciated.
    Last edited by pike; 01-29-2012 at 03:24 AM. Reason: add code tags for newbie

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

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