Solved

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

Posted on 2016-11-01
2
193 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 52

Accepted Solution

by:
Rgonzo1971 earned 500 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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Some code to ensure data integrity when using macros within Excel. Also included code that helps secure your data within an Excel workbook.
Access developers frequently have requirements to interact with Excel (import from or output to) in their applications.  You might be able to accomplish this with the TransferSpreadsheet and OutputTo methods, but in this series of articles I will di…
Graphs within dashboards are meant to be dynamic, representing data from a period of time that will change each time the dashboard is updated with new data. Rather than update each graph to point to a different set within a static set of data, t…
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…

623 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