How can I align pictures to the columns in code

M

Michelle

Hello, I want to bring in pictures and align and size them so that they sit
exactly between the borders of the B column

The left side of my shape should end up on the border between A and B and
the right side, on the border between B and C

Does that make sense?

The columns in the sheet may be different sizes so I'll need to include a
way of locating the left and right before positioning the picture. I can't
assume they'll always be the same.

Is this possible

Many thanks

M
 
R

Rick Rothstein

Try this (changing the worksheet name and picture shape name references to
what you are using in your code)...

With Worksheets("Sheet1").Shapes("Picture 1")
.Left = Range("B:B").Left
.Width = Range("B:B").Width
End With
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top