K
kirkm
Hi,
I have a bit of code e.g.
Dim wk As Workbook
Set wk = ActiveWorkbook
Dim sht As Worksheet
Set sht = wk.Worksheets("Reports")
With sht
..Cells.ClearContents
End With
This clears the sheet, as required, BUT if I add this next:
With Worksheets("Reports")
Set rng =
Worksheets("Reports").Range("A1").SpecialCells(xlCellTypeLastCell)
LastRow = rng.Row
End With
LastRow still contains the number of lines in the just cleared sheet.
Can I do something to make LastRow variable correct?
Thanks - Kirk
I have a bit of code e.g.
Dim wk As Workbook
Set wk = ActiveWorkbook
Dim sht As Worksheet
Set sht = wk.Worksheets("Reports")
With sht
..Cells.ClearContents
End With
This clears the sheet, as required, BUT if I add this next:
With Worksheets("Reports")
Set rng =
Worksheets("Reports").Range("A1").SpecialCells(xlCellTypeLastCell)
LastRow = rng.Row
End With
LastRow still contains the number of lines in the just cleared sheet.
Can I do something to make LastRow variable correct?
Thanks - Kirk