Written by Allen Wyatt (last updated February 21, 2023)
This tip applies to Excel 2007, 2010, 2013, 2016, 2019, and Excel in Microsoft 365
When you have created a drawing object, you can fill it with a color of your choosing. This is easy to do by following these steps:
Once you select a color, Excel removes the color menu and fills the interior of the shape with the color selected. To remove a color you previously used, you can repeat the same steps, but in step 4 choose No Fill.
ExcelTips is your source for cost-effective Microsoft Excel training. This tip (6611) applies to Microsoft Excel 2007, 2010, 2013, 2016, 2019, and Excel in Microsoft 365.
Excel Smarts for Beginners! Featuring the friendly and trusted For Dummies style, this popular guide shows beginners how to get up and running with Excel while also helping more experienced users get comfortable with the newest features. Check out Excel 2013 For Dummies today!
Add a drawing object to your worksheet, and at some point, you may want to change that object's size. You can easily ...
Discover MoreExcel allows you to create all sorts of drawings using a wide assortment of tools. When you need to take an action upon ...
Discover MoreWant to add some spice to the graphics in your worksheets? There are many colors and effects in Excel that allow you take ...
Discover MoreFREE SERVICE: Get tips like this every week in ExcelTips, a free productivity newsletter. Enter your address and click "Subscribe."
2023-05-21 10:56:08
Tomek
Chandru,
What you created is not an actual single shape, but just four separate objects. You can format each of them, but not an area between them, as that area is not an object. Even if you group the four lines to be treated as one entity, what is between them is not part of any object. Hence, you have to create another object that is positioned exactly to match position of your lines, then fill that object with the colour of your choice. You may want to move that object behind the lines so that they are fully visible.
In short, it is easier to use one of many available shapes, in your case a rectangle, then format the outline and inside of that shape.
The only situation I can imagine that four lines would be useful is if you want each side of the shape to have different colour or other attributes (thickness, line-type, etc.). In such case I suggest creating the shape (rectangle) first, then creating the lines to match. That way the lines will be in front of the shape and fully visible.
2023-05-21 09:00:28
Peter Atherton
Chandru
You will already have the values for each line Top-Left, Top-Right etc. You can use the FreeForm shape in the Lines section, 2nd from right.
I recorded this macro to insert a triangle, drawn by clicking on each end point.
Sub FreeForm()
'
With ActiveSheet.Shapes.BuildFreeform(msoEditingAuto, 95.25, 135.75)
.AddNodes msoSegmentLine, msoEditingAuto, 96, 210
.AddNodes msoSegmentLine, msoEditingAuto, 192, 210.75
.AddNodes msoSegmentLine, msoEditingAuto, 95.25, 135.75
.ConvertToShape.Select
End With
End Sub
(see Figure 1 below)
It starts with size on screen and adds nodes for each end point and the last node equals the startpoint. If your shape is part of a chart then, I imagine, the nodes are the x,y co-ordinates on the chart.
Good luck with that ;-)
Figure 1.
2023-05-20 11:29:18
James Woolley
@rudolf
If your active sheet has an ActiveX control named CB_Dropdown1, this will change its BackColor to yellow:
ActiveSheet.CB_Dropdown1.BackColor = RGB(255, 255, 0)
2023-05-19 06:45:50
rudolf
Hello,
when I select one of my dropdown shapes, I then find mostly all options greyed out on the Format ribbon tab and I'm not able to change the background color or else.
Is there an option to enable/disable this somewhere?
I'm using Excel 2013, the shapes where added using the Active-X Controls toolbox.
Registered a macro just to be shure and it shows me "ActiveSheet.Shapes.Range(Array("CB_Dropdown1")).Select".
Tried to change the BackColor via VBA (this is what I really want to do) but no luck at all and stumbling around I found your tip and noticed that for my dropdown shape most of the format options are greyed out. So maybe there's a possibility to resolve?
Hopefully,
Rudolf
2020-03-19 02:07:07
Chandru
Thanks for the tip. If a different object is created by individual line shapes, how can we fill color inside that object? For example, I have created a rectangle using four line shapes instead of rectangle shape from the tool, and my concern is I need to fill the rectangle created by 4 line shapes.
Got a version of Excel that uses the ribbon interface (Excel 2007 or later)? This site is for you! If you use an earlier version of Excel, visit our ExcelTips site focusing on the menu interface.
FREE SERVICE: Get tips like this every week in ExcelTips, a free productivity newsletter. Enter your address and click "Subscribe."
Copyright © 2023 Sharon Parq Associates, Inc.
Comments