Plotting horizontal bars over range

verter2k

New Member
Joined
Mar 21, 2015
Messages
7
Hi fellow Excel professionals,

I searched the Web and the forum, but didn't find the solution for a problem very similar to one regularly and recently discussed. I have to draw dynamic bar chart colored red, amber, or green depending on whether the value crossed the limit. That is an easy part. I also need to show the range itself as a bar (I tried to put transparent grey bar over the first one, but without much success). Is this possible at all? The problem with the range is that it doesn't start from 0. All values are within 0-100. No need to have any labels, but I tried to show gridlines, and if I put white box to remove lower part of the range bar, gridlines there are removed, too. It is a kind of box plot but a bit different.

Any ideas? MS Excel 2016 Win/Mac - if there is a possibility to do this in VBA, just let me know! Appreciate any advice!

Kindest regards,
Paolo
 

Excel Facts

Wildcard in VLOOKUP
Use =VLOOKUP("Apple*" to find apple, Apple, or applesauce
Hi

If you want to fill a bar with the range image, this is the code:


Code:
Sub Export()
Dim ws As Worksheet, r As Range, p As Point, s$, co As ChartObject
Set ws = ActiveSheet
Set r = ws.[d80:j82]
r.CopyPicture xlScreen, xlPicture
Set co = ws.ChartObjects.Add(Left:=0, Top:=0, Width:=r.Width, Height:=r.Height)
co.Activate
s = "c:\users\public\rng.jpg"
With co.Chart
    .Paste
    .Export Filename:=s, Filtername:="JPG"
End With
co.Delete
Set p = ws.ChartObjects("Chart4").Chart.FullSeriesCollection(2).Points(6)
p.Format.Fill.UserPicture s
End Sub
 
Upvote 0
Thank you!
It's not exactly like this, I've eventually found a solution for a single colored bar chart, but still don't know how to do this for a conditionally colored bar chart, which I able to produce independently. The image of current design is here
64375701_barchart.png
https://pixhost.org/show/156/64375701_barchart.png
 
Last edited:
Upvote 0
This is very nice and almost like the one I need. A friend of mine solved the problem using several tables (1 for every bar) and putting #N/A instead of 0 to prevent from displaying when needed.
 
Upvote 0

Forum statistics

Threads
1,224,823
Messages
6,181,178
Members
453,021
Latest member
Justyna P

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top