Hi, I want to add an item to the 1st empty row of a dynamic range, and then sort the range alphabetically.
The code I have to add the item - which does not produce an error, but also doesn't add the item to the range is:
I enter the new item into TextBox2 and then click CommandButton AddActionBtn.
Once I've added the the new item I would like to sort the range on column A alphabetically.
Thanks for any help
David
The code I have to add the item - which does not produce an error, but also doesn't add the item to the range is:
Code:
Private Sub AddActionBtn_Click()
Dim rng As Range
Dim N As Long
Dim ws As Worksheet
ActiveSheet.Unprotect
Set ws = Worksheets("Actions")
N = Cells(Rows.Count, "A").End(xlUp).Row + 1
Cells(N, "A").Value = TextBox2.Value
End Sub
I enter the new item into TextBox2 and then click CommandButton AddActionBtn.
Once I've added the the new item I would like to sort the range on column A alphabetically.
Thanks for any help
David