I have a list of values which when a button is clicked are copied to a hidden sheet, code is ran, and then they are returned to a new position in the previous sheet.
Using this code
However what I want to be able to add to this, is that if the value in the first row is deleted, then I would like the value in the 2nd row to move upto the top, 3rd row to 2nd.
Similarly if the value in the 2nd row is empty I would like the value in the 3rd row to move up to the 2nd row.
I know I can do this with lots of if statements, but as I will be adding more rows to that code (up to about 10), this will end up being a very long statement the way I can work out how to do it.
Any ideas how to do this in a shorter way?
Using this code
Code:
lngReminders = Sheets("Detailed").Cells(Rows.Count, "F").End(xlUp).Row
ws3.Range("A1") = ws2.Range("A" & lngReminders + 1)
ws3.Range("A2") = ws2.Range("A" & lngReminders + 2)
ws3.Range("A3") = ws2.Range("A" & lngReminders + 3)
*Some Code*
lngReminders = Sheets("Detailed").Cells(Rows.Count, "F").End(xlUp).Row
ws2.Range("A" & lngReminders + 1) = ws3.Range("A1")
ws2.Range("A" & lngReminders + 2) = ws3.Range("A2")
ws2.Range("A" & lngReminders + 3) = ws3.Range("A3")
However what I want to be able to add to this, is that if the value in the first row is deleted, then I would like the value in the 2nd row to move upto the top, 3rd row to 2nd.
Similarly if the value in the 2nd row is empty I would like the value in the 3rd row to move up to the 2nd row.
I know I can do this with lots of if statements, but as I will be adding more rows to that code (up to about 10), this will end up being a very long statement the way I can work out how to do it.
Any ideas how to do this in a shorter way?