+ Reply to Thread
Results 1 to 5 of 5

showing/hiding an image with a button

Hybrid View

redbullah showing/hiding an image with... 05-04-2010, 11:08 AM
Domski Re: showing/hiding an image... 05-04-2010, 11:20 AM
redbullah Re: showing/hiding an image... 05-04-2010, 11:51 AM
Domski Re: showing/hiding an image... 05-04-2010, 12:04 PM
redbullah Re: showing/hiding an image... 05-04-2010, 12:21 PM
  1. #1
    Registered User
    Join Date
    03-07-2010
    Location
    Germany
    MS-Off Ver
    Excel 2007
    Posts
    16

    showing/hiding an image with a button

    hello, is it possible to assign a macro to a button that will hide a specified image on the worksheet/or show if it's hidden?
    Last edited by redbullah; 05-04-2010 at 12:21 PM.

  2. #2
    Forum Expert Domski's Avatar
    Join Date
    12-14-2009
    Location
    A galaxy far, far away
    MS-Off Ver
    Darth Office 2010
    Posts
    3,950

    Re: showing/hiding an image with a button

    Something like this should do the trick:

    Sub Test()
    
    With Sheets("Sheet1").Shapes("Picture 1")
    
        If .Visible Then
        
            .Visible = False
            
        Else
        
            .Visible = True
            
        End If
        
    End With
    
    End Sub

    Dom
    "May the fleas of a thousand camels infest the crotch of the person who screws up your day and may their arms be too short to scratch..."

    Use code tags when posting your VBA code: [code] Your code here [/code]

    Remember, saying thanks only takes a second or two. Click the little star to give some Rep if you think an answer deserves it.

  3. #3
    Registered User
    Join Date
    03-07-2010
    Location
    Germany
    MS-Off Ver
    Excel 2007
    Posts
    16

    Re: showing/hiding an image with a button

    thanks but i don't know where picture1 is. i have multiple images on my worksheet, so how can i assign them names?

  4. #4
    Forum Expert Domski's Avatar
    Join Date
    12-14-2009
    Location
    A galaxy far, far away
    MS-Off Ver
    Darth Office 2010
    Posts
    3,950

    Re: showing/hiding an image with a button

    If you select a picture it's name will appear in the Name Box in the top left hand corner of the screen.

    Dom

  5. #5
    Registered User
    Join Date
    03-07-2010
    Location
    Germany
    MS-Off Ver
    Excel 2007
    Posts
    16

    Re: showing/hiding an image with a button

    thanks for your time Domski, it surely did the trick i just wrote the name of my worksheet that includes the images that i want to hide instead of Sheet1, and the name of the picture instead of Picture 1 and it worked!

+ 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