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


Reply
 
Thread Tools Display Modes
  #1  
Old 12-10-2010, 12:10 PM
rwandamark rwandamark is offline
Newcomer
 
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!
Mark
Reply With Quote
  #2  
Old 12-10-2010, 03: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
Default

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:
Code:
Sub SendLogoToBack()

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

Tags
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

Advertisement:





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.
subscribe
Programmers Heaven C# School Book -Free 338 Page eBook
The Programmers Heaven C# School book covers the .NET framework and the C# language.
subscribe
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..
subscribe
 
 
-->