Public l As Long
Private Sub UserForm_Initialize()
Dim nbl&
l = Cells(1, 2).End(xlDown).Row
nbl = ActiveCell.Row - l
SpinButton1.Max = nbl
SpinButton1.Value = SpinButton1.Min
TextBox1 = Cells(l, 2)
TextBox2 = Cells(l, 3)
TextBox3 = Cells(l, 4)
End Sub
Private Sub CommandButton1_Click()
Application.ScreenUpdating = False
With Cells(ActiveCell.Row - 1, 2)
.Resize(2, 3).FillDown: .Offset(1, 0) = TextBox1: .Offset(1, 1) = TextBox2: .Offset(1, 2) = TextBox3
End With
Application.ScreenUpdating = True
End Sub
Private Sub SpinButton1_Change()
TextBox1 = Cells(l + (SpinButton1.Value - 1), 2)
TextBox2 = Cells(l + (SpinButton1.Value - 1), 3)
TextBox3 = Cells(l + (SpinButton1.Value - 1), 4)
End Sub