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
Solved

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

Posted on 2016-11-01
2
80 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 50

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

Networking for the Cloud Era

Join Microsoft and Riverbed for a discussion and demonstration of enhancements to SteelConnect:
-One-click orchestration and cloud connectivity in Azure environments
-Tight integration of SD-WAN and WAN optimization capabilities
-Scalability and resiliency equal to a data center

Question has a verified solution.

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

Excel can be a tricky bit of software to get your head around. Whilst you’ll be able to eventually get to grips with the basic understanding of how to get by, there are a few Excel tips that not everybody will even know about let alone know how to d…
When you see single cell contains number and text, and you have to get any date out of it seems like cracking our heads.
The viewer will learn how to use a discrete random variable to simulate the return on an investment over a period of years, create a Monte Carlo simulation using the discrete random variable, and create a graph to represent the possible returns over…
This Micro Tutorial demonstrates using Microsoft Excel pivot tables, how to reverse engineer competitors' marketing strategies through backlinks.

792 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