title: excel vba to copy row with activex button
body: <p>I am not expert in excel so not sure how to achieve this.</p>
  
  <p>I am having a requirement where. there will be a button (Add button) which will add a new row.
  this existing sheet contains the rows with data and on Column A there is an ActiveX button (validate button - there is a code against each of this button).</p>
  
  <p>So while I will click Add button it will add a row on the bottom with an Activex button(validate button) in the column A and the code against it in the back end.</p>
  
  <p>could you please let me know how I can achieve this?</p>
  
  <p>sample image of the excel sheet: <a href="https://ibb.co/cijovv" rel="nofollow noreferrer">https://ibb.co/cijovv</a></p>
  
  <p>The code I have written which only adds a row but not able to copy the ActiveX button on column A and the code at the backend.</p>
  
  <p>Add row code:</p>
  
  <pre><code>Private Sub CommandButton1_Click()
  
  Dim Lr As Integer
  Dim newLr As Integer
  Dim lim As String
  
  Lr = Range("A" &amp; Rows.Count).End(xlUp).Row 'Searching last row in column A
  newLr = Lr + 1
  lim = "B" &amp; newLr &amp; ":" + "D" &amp; newLr
  Application.CopyObjectsWithCells = True
  Rows(Lr).Copy
  Rows(newLr).Insert
  'Range(lim).ClearContents
  Application.CopyObjectsWithCells = False
  
  End Sub
  </code></pre>