I am working on Stock OHLC Chart present in Sheets("Exhibit") and selecting Data from Sheets("75Min"). However i am succeeding to choose appropriate data range but can not add at Line Nu 15 .SetSourcedata, could you please help me to get out from this problem Code is as follows.
Sub Edit75MinChartToOHLCCandlestickChart()
Dim OHLCChart As ChartObject
Dim LastRow As Integer
Dim RngSt As Integer
Sheets("75Min").Select
Range("A1").Select
Range("A1").End(xlDown).Select
LastRow = ActiveCell.Row
RngSt = LastRow - 59
RngEnd = LastRow + 15
Set OHLCChart = ThisWorkbook.Worksheets("Exhibit").ChartObjects(1)
With OHLCChart.Chart 'Worksheets("Exhibit").ChartObjects("Chart 2").Chart
.SetSourceData ThisWorkbook.Worksheets("75Min").Range(RngSt, RngEnd)
.ChartType = xlStockOHLC
.HasTitle = True
.ChartTitle.Text = "75Min Candlestick chart"
.Axes(xlValue, xlPrimary).HasTitle = False
.Axes(xlValue, xlPrimary).AxisTitle.Characters.Text = "Price"
.PlotArea.Format.Fill.ForeColor.RGB = RGB(242, 242, 242)
.ChartArea.Format.Line.Visible = msoFalse
.Parent.Name = "OHLC Chart"
End With
End Sub
Thank You