+ Reply to Thread
Results 1 to 2 of 2

display a picture in excel as an icon

  1. #1
    Jeff
    Guest

    display a picture in excel as an icon

    Hello,

    I want to put a picture in a Excel cell and have it represented as an icon
    until someone clicks on it.

    What we have is an inventory list with pictures.

    Nothing I've tried seems to work very well.

    Thanks,

  2. #2
    Dave Peterson
    Guest

    Re: display a picture in excel as an icon

    Maybe you could put both the thumbnail and larger picture on the worksheet.

    Then assign them the same macro. If you use nice names, it might even work!

    I named my pictures:

    Pic01_B, Pic01_S
    (big and Small)
    through
    pic99_B, Pic99_S

    Option Explicit
    Sub testme()

    Dim myPict As Picture
    Dim OtherChar As String
    Set myPict = ActiveSheet.Pictures(Application.Caller)

    If LCase(Right(myPict.Name, 1)) = "s" Then
    OtherChar = "b"
    Else
    OtherChar = "s"
    End If

    myPict.Visible = False
    ActiveSheet.Pictures(Left(myPict.Name, Len(myPict.Name) - 1) _
    & OtherChar).Visible = True

    End Sub

    This doesn't have any validation. You could either add it or be really careful
    naming those pictures <vbg>.



    Jeff wrote:
    >
    > Hello,
    >
    > I want to put a picture in a Excel cell and have it represented as an icon
    > until someone clicks on it.
    >
    > What we have is an inventory list with pictures.
    >
    > Nothing I've tried seems to work very well.
    >
    > Thanks,


    --

    Dave Peterson

+ Reply to Thread

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