title: Macro that moves many sections of my worksheet is getting a syntax error, where did I go wrong?
body: <p>I somehow broke this super awesome code VBasic2008 gave me a few months ago. The workbook was getting super slow, probably because I wasn't using it properly and I just kept bolting things onto it. So I have just recreated it to see if I could simplify some of my additions and if I could remove any steps.
  I have one macro that runs most of the others but as it ran and moved into the big section of the process that moves many different types of rows, I'm getting a syntax error that I didn't before. It gave me the error on the first section (NoAddress) so I'm expecting it to do the same on each of the following sections.</p>
  <pre><code>
  Sub MoveMatchingRows( _
          ByVal SourceWorksheet As Worksheet, _
          ByVal SourceColumn As Long, _
          ByVal SourceCriteria As Variant, _
          ByVal DestinationWorksheet As Worksheet, _
          Optional ByVal DestinationColumn As Long = 1, _
          Optional ByVal DoClearPreviousDestinationData As Boolean = False)
      
      Const ProcTitle As String = &quot;Move Matching Rows&quot;
      
      ' Remove any previous filters.
      If SourceWorksheet.AutoFilterMode Then
          SourceWorksheet.AutoFilterMode = False
      End If
      
      ' Filter.
      Dim srg As Range ' Source Range (Headers and Data)
      Set srg = SourceWorksheet.Range(&quot;A1&quot;).CurrentRegion
      srg.AutoFilter SourceColumn, SourceCriteria, xlFilterValues
      
      ' Create a reference to the Source Data Range (no headers).
      Dim sdrg As Range
      Set sdrg = srg.Resize(srg.Rows.Count - 1).Offset(1)
      
      ' Clear Destination worksheet.
      If DoClearPreviousDestinationData Then ' new data, copies headers
          DestinationWorksheet.Cells.Clear
      End If
      
      ' Attempt to create a reference to the Source Data Filtered Rows Range.
      Dim sdfrrg As Range
      On Error Resume Next
          Set sdfrrg = sdrg.SpecialCells(xlCellTypeVisible)
      On Error GoTo 0
      
      If Not sdfrrg Is Nothing Then
          
          ' Create a reference to the Destination Cell (also, add headers).
          Dim dCell As Range ' Destination Cell
          Set dCell = DestinationWorksheet.Cells(1, DestinationColumn)
          If IsEmpty(dCell) Then
              srg.Rows(1).Copy dCell
              Set dCell = dCell.Offset(1)
          Else
              Set dCell = DestinationWorksheet.Cells( _
                  DestinationWorksheet.Rows.Count, DestinationColumn) _
                  .End(xlUp).Offset(1, 0)
          End If
          
          With sdfrrg
              .Copy dCell
              
              ' Either delete the entire worksheet rows...
              '.EntireColumn.Delete
              
              ' ... or remove filter to prevent...
              SourceWorksheet.AutoFilterMode = False
              ' ... deleting the entire worksheet rows leaving possible data
              ' to the right (after the empty column) intact.
              .Delete xlShiftUp
          
          End With
      
      Else ' no matches
          
          SourceWorksheet.AutoFilterMode = False
     
      End If
          
  End Sub
  _____________________________________________________________________
  
  Sub NoAddress()
      MoveMatchingRows Sheet1, 6, &quot;=&quot;, Sheet12, 1, False
  End Sub
  ________________________________________________
  
  Sub Zoos()
      MoveMatchingRows Sheet1, 4, &quot;*Zoos*&quot;, Sheet11, 1, False
  End Sub
  ______________________________________
  
  Sub MoveMemorial()
      MoveMatchingRows Sheet1, 18, &quot;Memorial&quot;, Sheet6, 1, False
  End Sub
  _______________________________________
  
  Sub MoveHonor()
      MoveMatchingRows Sheet1, 18, &quot;Honor&quot;, Sheet6, 1, False
  End Sub
  _______________________
  
  Sub MoveMatchingGift()
      MoveMatchingRows Sheet1, 4, &quot;*Matching Gift*&quot;, Sheet9, 1, False
  End Sub
  ______________________
  
  Sub MovePayroll()
      MoveMatchingRows Sheet1, 4, &quot;*Payroll*&quot;, Sheet9, 1, False
  End Sub
  ________________________________
  
  Sub NotGenOpFund()
      MoveMatchingRows Sheet1, 23, &quot;&lt;&gt;*FD.IND.GenOp*&quot;, Sheet12, 1, False
  End Sub
  _____________________________________________________________________
  
  Sub GiftMemberships()
      MoveMatchingRows Sheet1, 15, &quot;&lt;&gt;&quot;, Sheet10, 1, False
  End Sub
  _____________________________________________________________________
  
  Sub More_Gift_Mems()
      MoveMatchingRows Sheet1, 25, &quot;*gift for*&quot;, Sheet10, 1, False
  End Sub
  ____________________________________________________________________
  
  Sub Gift_Mem_Recipient()
      MoveMatchingRows Sheet1, 31, &quot;&lt;&gt;&quot;, Sheet10, 1, False
  End Sub
  __________________________________
  
  Sub Move_Managed()
      MoveMatchingRows Sheet1, 19, &quot;&lt;&gt;&quot;, Sheet5, 1, False
  End Sub
  ___________________________
  
  Sub Stock_InKind_IRA()
      MoveMatchingRows Sheet1, 34, &quot;&lt;&gt;&quot;, Sheet7, 1, False
  End Sub
  _____________________________________________________________________
  
  Sub Move_DAF()
      MoveMatchingRows Sheet1, 42, &quot;&lt;&gt;*/*&quot;, Sheet8, 1, False
  End Sub
  ______________________
  
  Sub Oddballs()
      MoveMatchingRows Sheet1, 3, &quot;&lt;&gt; *AF.IND*&quot;, Sheet12, 1, False
  End Sub
  _____________________________
  
  
  Sub Over_500_Unmanaged()
      MoveMatchingRows Sheet1, 15, &quot;&gt;=500&quot;, Sheet4, 1, False
  End Sub
  _____________________________
  
  Sub Over_250_Unmanaged()
      MoveMatchingRows Sheet1, 15, &quot;&gt;=250&quot;, Sheet3, False
  End Sub
  
  
  
  </code></pre>
  <p>What did I do wrong here?</p>
  <p>Update (4.8.22)
  I removed the &quot;...1, FALSE&quot; from everything but I am still getting an error that says the subroutine may not be available or all macros may be disabled. When you said to put quotes around all of my numbers, you weren't talking about the numbers that reference the data columns were you? I don't think you were but I tried it anyway and it didn't help. Do you have any suggestions on what I might try next?</p>