title: Out of Memory Error in VBA Code
body: <p>Good afternoon,</p>
  
  <p>Receiving the out of memory error in my code, any suggestions to change to code? </p>
  
  <p>Inputs from column A are transferred to 2 different cells. </p>
  
  <p>Output 1: Concatenates all the data from column A with commas inserted - between each cell value
  Output 2: Concatenates all the data from column A with commas and quotes inserted - for every cell value</p>
  
  <p>Thanks</p>
  
  <pre><code>Sub Inserting_Commas()
  ' Macro to insert commas at the end of end cell value &amp; to convert values from rows to single column
  
  Range("A2").Select
  
  Dim lastRow As Long
  Dim outputStr As String
  Dim outputStr2 As String
  Dim rownumber As Long
  
  Sheets("Sheet1").Select
  lastRow = Range("A" &amp; Rows.Count).End(xlUp).Row
  
  ' Seperate the column A by Commas
  outputStr = Range("A2")
  
  For rownumber = 3 To lastRow
      outputStr = outputStr &amp; "," &amp; Range("A" &amp; rownumber)
  Next
  
  Range("D2") = outputStr
  
  ' Seperate the Column with Quotes and Commas
  Range("A2").Select
  
  For rownumber = 2 To lastRow
      Range("B" &amp; rownumber).Value = "''" &amp; Range("A" &amp; rownumber) &amp; "'"
  Next
  
  ' --------------------------------------
  
  outputStr2 = "'" &amp; Range("B2")
  
  For rownumber = 3 To lastRow
      outputStr2 = outputStr2 &amp; "," &amp; Range("B" &amp; rownumber)
  Next
  
  Range("D20") = outputStr2
  
  End Sub
  </code></pre>