Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Align a picture/shape in the middle of a range("A1:H10")
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/ |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Align a picture/shape in the middle of a range("A1:H10")
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/ . |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
How can I "align middle" the legend and plot area? | Charts and Charting in Excel | |||
Chg 1 "Last, First Mid" column to 3 "First", "Middle", "Last" colu | Excel Discussion (Misc queries) | |||
Align a picture/shape in the middle of a range("A1:H10") | Excel Programming | |||
align a picture/shape in a Range! | Excel Programming | |||
Using "Cells" to write "Range("A:A,H:H").Select" | Excel Programming |