title: Excel VBA: Get Minimum out of 1 Dimension in Multi Dimensional Array
body: <p>for work, I need to adjust some prewritten VBA code. But I am rather a beginner, thus it is quite challenging for me.</p>
  
  <p>The code creates a 2D array called Targets. It spans by (a variable number of ) KPIs and for each KPI the values for 10 years (fix number). E.g.:</p>
  
  <p><strong>KPI 1</strong> year_1 year_2 ... year_10<br/>
  <strong>KPI 2</strong> year_1 year_2 ... year_10<br/>
  ...   ...    ....   ... .....   ...    ....   ... .....   ...    ...<br/>
  <strong>KPI n</strong>  year_1 year_2 ... year_10<br/></p>
  
  <p>I now need to calculate the minimum per KPI line (1D array).</p>
  
  <p>My ugly working code: 
  <br/><code>WorksheetFunction.Min(Targets(k, 0), Targets(k , 1), Targets(k, 2), Targets(k, 3), Targets(k , 4), Targets(k , 5), Targets(k, 6), Targets(k, 7), Targets(k, 8), Targets(k , 9))</code></p>
  
  <p>Where k is directing to the correct KPI.</p>
  
  <p>How can I make it work such that it basically takes the entire line without me having to direct the code to each specific cell? (e.g. Targets (k,:) or Targets (k, 0 to 9))</p>
  
  <p>Bonus question: Some values within these arrays are zero as they are tbd. Those are supposed to be excluded from the minimum. So I need the Minimum > zero. Can you figure that out too?</p>
  
  <p>It probably is super easy. But I cannot seem to make it work.</p>
  
  <p>Thanks so much in advance!</p>