LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
Max Max is offline
external usenet poster
 
Posts: 390
Default Aligning Pictures to a cell

Hello All,
I am in need of help with changing code.
This file is a league table (log).
At present I have code written by Bernie Deitrick. This code changes the
position of the relevant team badges (picture) as the teams name moves up or
down the league table, so the picture will move up or down with the team name.
I have copied the same code into a file for a Rugby table, but I have two
pictures linked for each team, 1 for the team badge and the other for the
country flag.

Here is the code that changed the badge.

Option Explicit

Private Sub Worksheet_Calculate()
Dim oPic As Picture
Dim rCell As Range
Me.Pictures.Visible = True
For Each rCell In Range("B4:B17").Cells
With rCell
Set oPic = Me.Pictures(Replace(.Text, " ", ""))
oPic.Visible = True
oPic.Top = .Top + .Height / 1.4 - oPic.Height / 1.4
oPic.Left = .Offset(0, 1).Left + .Offset(0, 1).Width / 2 -
oPic.Width / 2
End With
Next rCell
End Sub

How can this be adapted to change two pictures for each respective team each
time it moves up or down the league table?

Thank you for your help.

Max



 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Question on aligning a cell itself, not the text Susan Excel Discussion (Misc queries) 4 September 24th 08 02:32 PM
Shortcut key for aligning data in cell Sanjay Excel Discussion (Misc queries) 3 July 15th 08 06:53 PM
Aligning a connector to a cell edge? Dan Excel Programming 3 March 15th 07 02:00 AM
Aligning within a cell Squeaky Excel Worksheet Functions 5 December 6th 06 03:40 PM
Aligning decimal numers to the centre of the cell and aligning dec Ramesh Babu Excel Discussion (Misc queries) 1 July 1st 06 10:33 PM


All times are GMT +1. The time now is 10:04 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"