Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 226
Default Format Shape With ThemeColors

I can format shapes with RGB
ActiveSheet.Shapes("Test").Fill.ForeColor.RGB = RGB(128, 128, 128)
Is there a way to format a shape using themecolors in the same way you can
format a cell
With Range("A1").Interior
.ThemeColor = xlThemeColorAccent3
.TintAndShade = 0.799981688894314
End With
I have tried every variation of the code & syntax to no avail - could
someone give me an example of the code to do this please - thankyou in
anticipation
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 38
Default Format Shape With ThemeColors

This is the sort of syntax you are looking for:

ActiveSheet.Shapes.Range(Array("Test")).Select
With Selection.ShapeRange.Fill
.Visible = msoTrue
.ForeColor.ObjectThemeColor = msoThemeColorAccent3
.ForeColor.TintAndShade = 0.8
.Transparency = 0
.Solid
End With
With Selection.ShapeRange.Line
.Visible = msoTrue
.ForeColor.ObjectThemeColor = msoThemeColorAccent6
.ForeColor.TintAndShade = 0.4
.Transparency = 0
End With

You can drop things like transparency and solid if you won't need to
change them, but sometimes it is better to be sure (eg colours will look
wrong if the transparency is not 0).
For TintAndShade I tend to use rounded numbers, although they won't
exactly match the choices in the gallery (but it also means you have
easy access to a wider range if you want to, while remaining 'theme aware')

Hope this helps

Adam

Roger wrote:
I can format shapes with RGB
ActiveSheet.Shapes("Test").Fill.ForeColor.RGB = RGB(128, 128, 128)
Is there a way to format a shape using themecolors in the same way you can
format a cell
With Range("A1").Interior
.ThemeColor = xlThemeColorAccent3
.TintAndShade = 0.799981688894314
End With
I have tried every variation of the code & syntax to no avail - could
someone give me an example of the code to do this please - thankyou in
anticipation

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Format Shape, will not move accordingly, when deleting columns TJ Excel Discussion (Misc queries) 3 June 5th 08 07:13 PM
my curser changed from arrow shape to a cross shape???? bj New Users to Excel 1 February 5th 07 02:47 PM
can I use conditional format on an auto shape Horse Excel Discussion (Misc queries) 1 February 5th 07 01:44 PM
conditinal format that gives particular shape and color in cell formatting Excel Discussion (Misc queries) 1 January 30th 07 11:33 PM
Chart in a Shape QPapillon Excel Discussion (Misc queries) 1 June 26th 06 04:17 PM


All times are GMT +1. The time now is 07:07 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"