VBA - Range.Row.Count

前端 未结 10 1518
别那么骄傲
别那么骄傲 2020-12-24 13:23

I have written a simple code to illustrate my predicament.

Sub test()
    Dim sh As Worksheet
    Set sh = ThisWorkbook.Sheets(\"Sheet1\")

    Dim k As Lon         


        
10条回答
  •  悲哀的现实
    2020-12-24 14:12

    Probably a better solution is work upwards from the bottom:

    k=sh.Range("A1048576").end(xlUp).row
    

提交回复
热议问题