View Single Post
 
Old 11-23-2020, 03:46 AM
p45cal's Avatar
p45cal p45cal is offline Windows 10 Office 2019
Expert
 
Join Date: Apr 2014
Posts: 866
p45cal has a reputation beyond reputep45cal has a reputation beyond reputep45cal has a reputation beyond reputep45cal has a reputation beyond reputep45cal has a reputation beyond reputep45cal has a reputation beyond reputep45cal has a reputation beyond reputep45cal has a reputation beyond reputep45cal has a reputation beyond reputep45cal has a reputation beyond reputep45cal has a reputation beyond repute
Default

Quote:
Originally Posted by massimodfd View Post
1. how to adapt the macro to a specific data sheet ?
The macro works on a chart, not a sheet. Record a macro selecting the sheet and then the chart. Copy the code here and I'll show you how to tweak it.

Quote:
Originally Posted by massimodfd View Post
2. where is the instructions creating the "button" ?
Developer tab, Controls section, Insert dropdown: choose top left button (Form Controls, (Button, Form Control). Then click on the sheet, an Assign Macro dialogue box pops up: choose the macro from the list, Click OK.
Quote:
Originally Posted by massimodfd View Post
3. where can I change the colour of the vertical line of the graph (currently grey)?
Manually, select one of them (all will be selected), right-click and choose Format Leader lines… you can select the colour in the pane which appears on the right. Automated, you need to use the likes of one of these:
Code:
    ActiveChart.FullSeriesCollection(1).LeaderLines.Format.Line.ForeColor.RGB = vbRed
    ActiveChart.FullSeriesCollection(1).LeaderLines.Format.Line.ForeColor.RGB = RGB(23, 185, 65)
    ActiveChart.FullSeriesCollection(1).LeaderLines.Format.Line.ForeColor.RGB = 11817066
To get the values after the equals sign for a specific colour of your liking, record a macro of you changing the colour of any line, fill of a cell, font colour, preferably using the More Colours… option, then the Custom tab (where you can see the individual Red/Green/Blue values) and you should see amongst the lines of recorded code the likes of:
Code:
.Color = 10605937
.ForeColor.RGB = RGB(46, 218, 46)
Use those values.
Reply With Quote