title: VBA how do i have the same code on a command button but with changed variables
body: <p>completely new to VBA (and coding really) and have started today so i can imagine this problem has a relatively simple fix. </p>
  
  <p>I want to create a revision logger for multiple subjects and the code just for 1 subject is working great. Here is what i have got. (i cannot place pictures so here is the link.)</p>
  
  <p><a href="http://i.imgur.com/Up2Pf8r.png" rel="nofollow">http://i.imgur.com/Up2Pf8r.png</a></p>
  
  <p>here is the code for the command button (notr stands for number of times revised)</p>
  
  <pre><code>Private Sub revision_Click()
  
  Dim check As String
  
  If revision.Caption = "StartRevision" Then
  revision.Caption = "EndRevision"
  Else
  revision.Caption = "StartRevision"
  End If
  
  Dim column As Integer
  Dim notr As Integer
  
  notr = Cells(*2*, 5).Value
  column = notr + 6
  
  
  If revision.Caption = "StartRevision" Then
  Cells(*3*, column).Value = Now
  Cells(*3*, column).NumberFormat = "dd/mm/yyyy hh:mm:ss"
  Cells(*4*, column).Value = Abs((Cells(2, column)) - (Cells(3, column)))
  Cells(*4*, column).NumberFormat = "hh:mm:ss"
  Else
  Cells(*2*, column).Value = Now
  Cells(*2*, column).NumberFormat = "dd/mm/yyyy hh:mm:ss"
  End If
  
  
  If revision.Caption = "StartRevision" Then
  notr = notr + 1
  Cells(*2*, 5).Value = notr
  End If
  
  
  End Sub
  </code></pre>
  
  <p>now though i wish to copy and paste that command button for the other subjects. Now i can do this easily by changing the numbers i have labelled with *'s every time for each button but i was wondering if there is a way of doing this but making those * numbers variables and just have that code once and then for each subject just have to change those variables instead of having to copy and paste the whole code many times.</p>
  
  <p>i understand that iam not being very clear so sorry :( but any help would be much appreciated. </p>
  
  <p>thanks.</p>