Hi Gurus
I have a dynamic range "Employees" that is made with the offset and counta functions. It goes from A1:C1 and down to the first empty cell before A20:C20.
The column headings are age, gender, salary
I am creating a userform which I can add new people, or change people's details, or delete them.
I'm really struggling to figure out how I can delete someone in the list (maybe in the middle of the list) but I do NOT want to delete the entire row - just the row from Ax:Cx. When I delete that entry, I would like the entries below to shift up, but I also want the dynamic range parameters to stretch down to A20:C20. This is because I have other tables to the right and below this table.
Suggestions??
Thanks in advance
This is my current code. It does nothing when I click the command button
People List is the A column (names)
txtRows is a textbox at the bottom of the page which says the row number the person is in the list
I have a dynamic range "Employees" that is made with the offset and counta functions. It goes from A1:C1 and down to the first empty cell before A20:C20.
The column headings are age, gender, salary
I am creating a userform which I can add new people, or change people's details, or delete them.
I'm really struggling to figure out how I can delete someone in the list (maybe in the middle of the list) but I do NOT want to delete the entire row - just the row from Ax:Cx. When I delete that entry, I would like the entries below to shift up, but I also want the dynamic range parameters to stretch down to A20:C20. This is because I have other tables to the right and below this table.
Suggestions??
Thanks in advance
This is my current code. It does nothing when I click the command button
People List is the A column (names)
txtRows is a textbox at the bottom of the page which says the row number the person is in the list
Code:
Private Sub cmdDeleteEntry_Click()
With Range("People_Table")
.Range("People_List")(txtRow.Value).EntireRow.Delete shift: x1shiftup
.Rows(.Rows.Count + 1).EntireRow.Insert
.Resize(.Rows.Count +1, .Columns.Count).People_Table
end with
end sub