You can count the cells first before showing the userform
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
If Target.Column <> 2 Then Exit Sub
If WorksheetFunction.CountA(Target.Offset(0, -1).Range("A1:L1")) < 10 Then Exit Sub
With UserForm1
.StartUpPosition = 0
.Left = Application.Left + (0.5 * Application.Width) - (0.5 * .Width)
.Top = Application.Top + (0.5 * Application.Height) - (0.5 * .Height)
.Show
End With
End Sub
Replace the code in the command button1 with this
Private Sub CommandButton1_Click()
Dim Rws As Long
Rws = Cells(Rows.Count, "B").End(xlUp).Row + 1
ActiveCell.Range("A1:B1").Copy Destination:=Cells(Rws, 2)
ActiveCell.Range("D1:F1").Copy Destination:=Cells(Rws, 5)
UserForm1.Hide
End Sub
Show us your attempts for the other questions.
Bookmarks