title: VBA Excel 2010 - LN function for a range
body: <p>when i'm using LN function in excel it allows me to select a range, yet when trying to use the same function in vba the argument must be double, how to tackle this problem?</p>
  
  <pre><code>        On Error Resume Next
  
              Application.EnableEvents = False
              With Sheets("Stale")
  
                      ostatnia = .Cells(6, Columns.Count).End(xlToLeft).Column
  
                      Set zakres = Range(.Cells(6, 6), .Cells(6, ostatnia))
                      Set zakres2 = Range(.Cells(5, 6), .Cells(5, ostatnia))
  
                       ***`logarytm = Application.WorksheetFunction.Ln(zakres2)`***
  
                          nachylenie = Application.WorksheetFunction.Slope(zakres, zakres2)
  
                      MsgBox nachylenie &amp; " $$ " &amp; logarytm
  
              End With
  
              Application.EnableEvents = True
  
          On Error GoTo 0
  </code></pre>