title: Brackets prevent function from running
body: <p>I am having difficulty getting my function to recognise the procedure because of where the brackets are.</p>
  
  <p>The following code does not work.</p>
  
  <p>Function</p>
  
  <pre><code>Public Function KonKatenate(rIN As range) As String
  Dim r As range
  For Each r In rIN
  KonKatenate = Replace(KonKatenate &amp; r.Text, ".", "")
  Next r
  End Function
  </code></pre>
  
  <p>Procedure</p>
  
  <pre><code>Sub LoopThroughUntilBlanks()
  
  Dim xrg As range
  
  Cells(3, 951).Select
  ' Set Do loop to stop when two consecutive empty cells are reached.
  Application.ScreenUpdating = False
  i = 3
  Do Until IsEmpty(ActiveCell) And IsEmpty(ActiveCell.Offset(0, -2).Value)
  Cells(i, 951).Value = KonKatenate(range("AJE" &amp; i &amp; ":AJG" &amp; i &amp; ")"))
  ActiveCell.Offset(1, 0).Select
  i = i + 1
  Loop
  Application.ScreenUpdating = False
  End Sub
  </code></pre>
  
  <p>When i completely remove the brackets and use for example a static number this works:</p>
  
  <pre><code>Cells(i, 951).Value = KonKatenate(range("AJE3:AJG3"))
  </code></pre>
  
  <p>However i need 3 to be a variable i so that the loop transcends down the row </p>
  
  <p>Advice is much needed</p>