VBA Excel - how to set PlotArea Format Texture Fill Offset

jdjehanneman

New Member
Joined
Mar 23, 2021
Messages
16
Office Version
  1. 365
Platform
  1. Windows
Hello,

I would like to modify via VBA code the offset of the texture fill for the PLOTAREA.

Offset.jpg


In order to be able to adjust the fill inside the plotarea to obtain something like this.

GRaph1.jpg


This is the code to activate the texture fill for the chart

VBA Code:
Function Functions_AddOffset(Chrt As Chart)
        Chrt.PlotArea.Select
        With Selection.Format.Fill
            .visible = msoTrue
            .UserPicture "C:\tmp\Grey.jpg"
            .TextureTile = msoFalse
        End With
    End Function

The only thing missing is the code to ste thet offset left and right

Hope you guys can help me out.
 

Attachments

  • GRaph1.jpg
    GRaph1.jpg
    46.8 KB · Views: 7

Excel Facts

Shade all formula cells
To shade all formula cells: Home, Find & Select, Formulas to select all formulas. Then apply a light fill color.
I can't find any way of accessing that in VBA. If you tile the picture as a texture, then you can set the TextureOffsetX and textureOffsetY in points, but I can't see a way to use percentages.
 
Upvote 0

Forum statistics

Threads
1,224,823
Messages
6,181,182
Members
453,020
Latest member
Mohamed Magdi Tawfiq Emam

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