Perhaps something like this:
Sub Test()
Dim Pict As Picture, rng As Range
Dim L As Long, T As Long
Application.ScreenUpdating = False
Set rng = Range("A1:H10")
Set Pict = ActiveSheet.Pictures. _
Insert("C:\Documents and Settings\greg\" & _
"My Documents\My Pictures\Sample.jpg")
L = rng.Left + rng.Width / 2 - Pict.Width / 2
T = rng.Top + rng.Height / 2 - Pict.Height / 2
Pict.Left = L: Pict.Top = T
Application.ScreenUpdating = True
End Sub
Regards,
Greg
-----Original Message-----
Hi!
Many Thanks in advance!
I have a few pictures, and or shapes, not necesarily the
pictures have
all the same size.
I do not want to change the Height or Width or my picture
I have a range("A1:H10")
How can I:
insert my picture as follws
HorizontalAlignment = xlCenter
VerticalAlignment = xlCenter
so;
keep my picture aligned horizontally and vertically in
the middle
of my range "A1:H10"
See you!
---
Message posted from http://www.ExcelForum.com/
.