try
Sub a()
on error resume next
LR = Cells(Rows.Count, "A").End(xlUp).Row
......