LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,670
Default How to insert 3 images into excel with aligning each positions?

Does anyone have any suggestions on how to insert 3 images into excel with
aligning each positions? Please see following code for detailed description.
Does anyone have any suggestions?
Thanks in advance for any suggestions
Eric


Private Sub Worksheet_Change(ByVal Target As Range)

Dim myPic As Object
Dim dblTop As Double
Dim dblLeft As Double
Dim dblHeight As Double
Dim dblWidth As Double

If Target.Address = "$A$1" Then
On Error Resume Next
Set myPic = ActiveSheet.Pictures(1)
On Error GoTo 0
If Not myPic Is Nothing Then myPic.Delete

If Range("A1") = 1 Then
Set myPic = ActiveSheet.Pictures.Insert("C:\TempPic.JPG")
Set myPic = ActiveSheet.Pictures.Insert("C:\TempPic3.JPG")
Set myPic = ActiveSheet.Pictures.Insert("C:\TempPic5.JPG")
' I try to insert more code here, but it does not work
Else
Set myPic = ActiveSheet.Pictures.Insert("C:\TempPic2.JPG")
Set myPic = ActiveSheet.Pictures.Insert("C:\TempPic4.JPG")
Set myPic = ActiveSheet.Pictures.Insert("C:\TempPic6.JPG")
End If

dblTop = Cells(10, "B").Top
dblLeft = Cells(10, "B").Left
dblHeight = Cells(14, "B").Top - Cells(10, "B").Top
dblWidth = Cells(10, "D").Left - Cells(10, "B").Left

'Furthermore, I get no idea on how to align 3 different images from
following code.
With myPic
.ShapeRange.LockAspectRatio = msoFalse '/ msoTrue
.Top = dblTop
.Left = dblLeft
.Height = dblHeight
.Width = dblWidth
End With

End If

End Sub
 
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
Excel 2007 insert HTML with images Excel 2007 insert HTML with images Excel Programming 0 May 13th 08 05:25 AM
insert images/pictures [email protected] Excel Programming 4 November 4th 07 08:48 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
help please (VBA to insert images) alenhart[_2_] Excel Programming 2 May 7th 06 12:21 AM
VBA code to insert images in excel sheet Riya Excel Programming 2 October 29th 03 12:22 PM


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

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

About Us

"It's about Microsoft Excel"