79497577

Date: 2025-03-10 09:41:21
Score: 0.5
Natty:
Report link

With the help of these answers I got this code to work

Private Sub BarGraphWithErrorBars(ByVal ShName As String, ByVal AvRange As Range, ByVal ErrRange As Range)

    AvRange.Select
    ActiveSheet.Shapes.AddChart2(201, xlColumnClustered).Select
    ActiveChart.FullSeriesCollection(1).HasErrorBars = True
    ActiveChart.FullSeriesCollection(1).ErrorBar Direction:=xlY, Include:=xlErrorBarIncludePlusValues, Type:=xlErrorBarTypeCustom, Amount:=ErrRange, MinusValues:=ErrRange
    
End Sub

I am adding more functionalities to it to fit the whole program, I suppose the main error was in the non-existing PlusValues parameter. Changing it to MinusValues does the trick, although I am using Plus values it seems counter intuitive.

Reasons:
  • Long answer (-0.5):
  • Has code block (-0.5):
  • Self-answer (0.5):
  • Low reputation (1):
Posted by: Mic Mic