VBA Refline

VBA and general Excel Q&A and examples
Post Reply
rholt
Posts: 4
Joined: Sun Jul 06, 2014 10:44 pm

VBA Refline

Post by rholt »

Afternoon,

I'm having some issues with the refline command in VBA.

Could someone please explain the standard means to define colours other than black. I require red (255,0,0) and Light Grey (192,192,192)

I need to output the following:

:arrow: Refline(15,5,???,10,-100,"300m curve")


Parameters:
1: draws line on secondary Y2 with label
2: 5 (medium dash)
3: need to specify red and light grey as explained
4: 10 is the line width in 1000ths of inches
5: value
6: legend entry for the reference line. Use "" if you don't want an entry in the legend.
User avatar
DPlotAdmin
Posts: 2312
Joined: Tue Jun 24, 2003 9:34 pm
Location: Vicksburg, Mississippi
Contact:

Post by DPlotAdmin »

The color values are red component + blue*256 + green*65536. That's a mess to do in your head, but they can be expressed in hexadecimal with a "0x" prefix, which makes it a bit easier. Red=255 can be expressed as 255 or 0xff (not case specific) or 0x0000ff. Your light grey can be expressed as 12632256 (192+(192*256)+(192*65536)) or 0xC0C0C0.
Visualize Your Data
support@dplot.com
Post Reply