I put checkboxes to all residents, the connection with the cell with logical values is confused, when the "Next" button is pressed
Sub Del_Row()
Rows(ActiveSheet.Cells(Rows.Count, 1).End(xlUp).Row).Delete
Cells(Cells(Rows.Count, 1).End(xlUp).Row, 11).Activate
n = ActiveSheet.CheckBoxes.Count
ActiveSheet.CheckBoxes(n).Delete
ActiveSheet.CheckBoxes(n - 1).Delete
ActiveSheet.CheckBoxes(n - 2).Delete
ActiveSheet.CheckBoxes(n - 3).Delete
End Sub
Sub Copy_Row()
Dim rw As Long
rw = Cells(Rows.Count, 1).End(xlUp).Row
Rows(rw).Copy
Rows(rw + 1).Insert xlDown
Rows(rw).Cells(1).Resize(2).DataSeries , xlChronological, xlMonth
Range("K" & rw + 1 & ":AQ" & rw + 1).ClearContents
n = ActiveSheet.CheckBoxes.Count
ActiveSheet.CheckBoxes(n).LinkedCell = "CW" & rw + 1
ActiveSheet.CheckBoxes(n - 1).LinkedCell = "CU" & rw + 1
ActiveSheet.CheckBoxes(n - 2).LinkedCell = "CS" & rw + 1
ActiveSheet.CheckBoxes(n - 3).LinkedCell = "CQ" & rw + 1
Range("K" & rw + 1).Activate
End Sub
It turned out that the cells are confused
Aucun commentaire:
Enregistrer un commentaire