Go Back  Xtreme Visual Basic Talk > Legacy Visual Basic (VB 4/5/6) > VBA / Office Integration > Excel > moving pictures to the back excel 2010

Thread Tools Display Modes
Old 12-10-2010, 01:10 PM
rwandamark rwandamark is offline
Join Date: Dec 2010
Posts: 1
Default moving pictures to the back excel 2010

Hi, I am relatively new to VBA in Excel 2010.
I have 4 logos strategically placed on top of one another.
When the user clicks the logo, I want to send it to the back, so that the one underneath will show up, and so one.
Can you direct me as to do this? I appreciate your details and assistance.

Thank you!
Reply With Quote
Old 12-10-2010, 04:22 PM
Colin Legg's Avatar
Colin Legg Colin Legg is offline
Out Of Office

Retired Moderator
* Expert *
Join Date: Mar 2005
Location: London, UK
Posts: 3,400

Welcome to the forum, Mark.

Sending a picture to the back is quite straightforward because the Picture class has a SendToBack method. The trick to this is being able to use a single procedure which can be assigned to all four logos: to do this you have to know which picture has been clicked. This can be done using Application.Caller.

Say the codename of the sheet is Sheet1. In a standard code module place this code:
Sub SendLogoToBack()

    Dim picLogo As Picture
    Set picLogo = Sheet1.Pictures(Application.Caller)
End Sub
Assign this procedure to all four logos and then you should be up and running...
RAD Excel Blog
Reply With Quote

excel, excel 2010 automation, vba

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump


Free Publications
The ASP.NET 2.0 Anthology
101 Essential Tips, Tricks & Hacks - Free 156 Page Preview. Learn the most practical features and best approaches for ASP.NET.
Programmers Heaven C# School Book -Free 338 Page eBook
The Programmers Heaven C# School book covers the .NET framework and the C# language.
Build Your Own ASP.NET 3.5 Web Site Using C# & VB, 3rd Edition - Free 219 Page Preview!
This comprehensive step-by-step guide will help get your database-driven ASP.NET web site up and running in no time..