hello there,
here is what I am trying to achieve:
modifiy the macro of the attached file so that it will draw lines on the graphs and end up ressembling the imge I attach as well
(thee segments connecting the two columns)
on top of the horizontal line I'd like to put the contents of a cell
is that feasible or better start drawing the lines myself?
ps. you need to create a sheet called graphs for the macro to run
You can use additional xy-scatter series to draw lines on a chart.
wow, this looks quite promising --
can you give me some guidance on how to code that on VBA?
the values of the scatterline I guess I can work them out, but I do not know quite the commands
also how did you manage to have all the bars sticked together?
thanks a lot
The bars are stuck together by setting,
Overlap = 100%
Gap Width = 0%
As to coding you just need to add a new series, ax xy-scatter, specifying the range used for x and y values.
Code:Sub AddLines() Dim rngXValues As Range Dim rngYValues As Range Set rngXValues = Range("R3:R7") Set rngYValues = Range("S3:S7") With ActiveSheet.ChartObjects(1).Chart With .SeriesCollection.NewSeries .ChartType = xlXYScatterLinesNoMarkers .Values = rngYValues .XValues = rngXValues End With End With End Sub
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks