Man_of_Sleep
New Member
- Joined
- Aug 5, 2020
- Messages
- 19
- Office Version
- 2013
- Platform
- Windows
Hi,
I have this code to insert new row button.
Then I am trying to insert the new row, with a new linked checkbox.
The checkbox is automatic linked to the new cell in the new added row.
I have this code to insert new row button.
VBA Code:
Option Explicit
Private Sub CommandButton1_Click()
addNewRow
End Sub
Sub addNewRow()
' Do not insert a row before the first row.
Dim iTopRow As Integer
iTopRow = 1
If (ActiveCell.Row > iTopRow) Then
' Get the active row number.
Dim rowNum As Integer
rowNum = ActiveCell.Row
Rows(rowNum).EntireRow.Insert ' Insert a new row.
End If
End Sub
Then I am trying to insert the new row, with a new linked checkbox.
The checkbox is automatic linked to the new cell in the new added row.