Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Excel 2016 VBA change shape fill color to that of a cell fill color

Posted on 2016-11-01
2
Medium Priority
?
373 Views
Last Modified: 2016-11-01
I can see how to do that with RGB for a Shape, but as far I can see cell interior color is not available as RGB.

I'm trying to make the interior fill color of a shape equal to the fill color of a specified cell.

Thanks for any help.
0
Comment
Question by:hindersaliva
2 Comments
 
LVL 53

Accepted Solution

by:
Rgonzo1971 earned 2000 total points
ID: 41868646
Hi,

pls try
Sub Macro1()

    Set shp = ActiveSheet.Shapes(1)
    With shp.Fill
        .Visible = msoTrue
        .ForeColor.RGB = Range("A1").Interior.Color
        .Transparency = 0
        .Solid
    End With
    
End Sub

Open in new window

Regards
0
 

Author Comment

by:hindersaliva
ID: 41868796
Perfect Rgonzo!
Thanks
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

There are times when I have encountered the need to decompress a response from a PHP request. This is how it's done, but you must have control of the request and you can set the Accept-Encoding header.
We live in a world of interfaces like the one in the title picture. VBA also allows to use interfaces which offers a lot of possibilities. This article describes how to use interfaces in VBA and how to work around their bugs.
This Micro Tutorial demonstrates in Microsoft Excel how to consolidate your marketing data by creating an interactive charts using form controls. This creates cool drop-downs for viewers of your chart to choose from.
This Micro Tutorial will demonstrate how to use a scrolling table in Microsoft Excel using the INDEX function.

885 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question