Solved

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

Posted on 2016-11-01
2
33 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 48

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

6 Surprising Benefits of Threat Intelligence

All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

Join & Write a Comment

Suggested Solutions

Introduction This Article briefly covers methods of calculating the NPV and IRR variants in Excel as well as the limitations in calculating and interpreting IRR results. Paraphrasing Richard Shockley, author of my favourite finance reference tex…
Convert between Excel file formats (.XLS, .XLSX, .XLSM) with/without macro option David Miller (dlmille) Intro Over this past Fall, I've had the opportunity to see several similar requests and have developed a couple related solutions associate…
The viewer will learn how to create two correlated normally distributed random variables in Excel, use a normal distribution to simulate the return on different levels of investment in each of the two funds over a period of ten years, and, create a …
This Micro Tutorial will demonstrate how to create pivot charts out of a data set. I also added a drop-down menu which allows to choose from different categories in the data set and the chart will automatically update.

762 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

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now