How to set the minimum scale to a specific cell value, where in the cell is not constant.
ie: if the minimum scale has to be set to 45, and if the value 45 doesn't always occur in the cell D14
?
.Axes(xlCategory, xlPrimary).MinimumScale = 45 ' Constant value
To set the minimum scale to the lowest value in the range, use the MIN
function. Now since the range in not in the workbook which has the chart but in the csv file which you are opening, you have to fully qualify the range
To do that, declare a range object and then set it to the relevant range
Dim Rng As Range
'
'~~> Rest of your code
'
Set wsTemp = wbTemp.Sheets(1)
Set Rng = wsTemp.Range("D3:D30")
'
'~~> Rest of your code
'
.Axes(xlCategory, xlPrimary).MinimumScale = Application.WorksheetFunction.Min(Rng)
HTH