clear last but one line to a userform
Hi
I have kindly been given a macro below that clears the last line and retains the formular to a userform list box.
Code:
Sub clear()
Dim x As Long
With Sheets("database")
x = .Cells(.Rows.Count, 1).End(xlUp).Row
.Cells(x, 1).EntireRow.SpecialCells(xlConstants).ClearContents
End With
End Sub
Is it possible to improve on the macro so that it never clears the very last row as this row contains the list box headings.
I could get around it also if the macro refered just to a range rather than the entire sheet!!!
Many thanks in advance
Regards
Keith
1 Attachment(s)
clear last but one line to a userform
Hi Guys
I still cannot get the code to work that prevents the headings (row 1) of the database, to remain, when clearing the rows on the Listbox on the userform.
I have attached the workbook in the hopes that you can revisit this problem and help me out.
Regards
Keith