VBA code to apply style to objects

Claymationator

Well-known Member
Joined
Sep 26, 2006
Messages
705
I need a quick code in VBA that I can use to put the following styles on an image that is found in my workbook....any ideas?

1. Black border
2. White fill color
3. Shadow - offset diagonal bottom right

Any help is appreciated.
 

Excel Facts

Show numbers in thousands?
Use a custom number format of #,##0,K. Each comma after the final 0 will divide the displayed number by another thousand
Hi Claymationator,

Select your image, then run this macro:

Code:
Sub SetPictureFormat()
   With Selection.ShapeRange
      .Fill.Visible = msoTrue
      .Fill.ForeColor.SchemeColor = 9
      .Line.Visible = msoTrue
      .Line.Weight = 2.25
      .Shadow.Type = msoShadow14
      .Shadow.IncrementOffsetX 3#
      .Shadow.IncrementOffsetY 3#
      .Shadow.Transparency = 0.5
   End With
End Sub

You will probably want to adjust some of the parameters to get the exact look (line width, etc.) you want.

Keep Excelling.

Damon
 
Upvote 0

Forum statistics

Threads
1,215,766
Messages
6,126,761
Members
449,336
Latest member
p17tootie

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top