Forum Discussion
GranSupt
Oct 30, 2024Copper Contributor
VBA code to reorganize range to fill empty rows
Excel 365. I have a small range "noteList" of 1 column (L) and 30 rows (13-43) on sheet "Home". I created a userform to add and clear contents of rows (to facilitate doing this from any sheet in the ...
HansVogelaar
Oct 30, 2024MVP
How about
Private Sub CommandButton3_Click()
Worksheets("Home").Range("L1").End(xlDown).Offset(1).Value = Me.TextBox2.Text
Unload Me
End Sub
or
Private Sub CommandButton3_Click()
Dim lngR As Long
With Worksheets("Home")
Do
lngR = lngR + 1
Loop Until .Range("L" & lngR).Value = ""
.Range("L" & lngR).Value = Me.TextBox2.Text
End With
Unload Me
End Sub