title: Call excel VBA module with variable change
body: <p>I would like to use the code below in multiple areas within my <code>excel VBA</code>, however there must be some changes to the variables within the code to make it specific to that area. E.g., </p>
  
  <pre><code>Dim XXXcountcurrent As Long
  
  ' Delete the items containing the word XXX in Material current
      Sheets("Materials Current").Select
      Range("A2:C" &amp; Cells(Rows.count, "A").End(xlUp).Row).SpecialCells(xlCellTypeVisible).Select
      If XXXcountcurrent &lt;&gt; 0 Then
      Selection.Rows.Delete
      End If
      ActiveSheet.Range("$A:$C").AutoFilter Field:=2
  
  'Paste XXX total in workings sheet
      Sheets("Workings").Select
      rcell.Offset(?) = XXXcountcurrent
  </code></pre>
  
  <p>The code above is a small section taken from the <code>VBA</code>. The XXX indicated refers to different scenarios, e.g., it could refer to <code>"knife"</code>, <code>"handle"</code> etc. In addition, I would like the offset cell to be adjusted in the code indicated by? (I am unassuming this must be variable as well).</p>
  
  <p>I do not want to repeat the code when there are only small changes to be made. Can someone please assist?</p>