返回列表 上一主題 發帖

[發問] 快速找出範圍內最大列數

回復 1# ciboybj
用搜尋快一些
  1. Option Explicit
  2. Sub Ex()
  3.     Dim Rng As Range
  4.     With Range("B2:E15")
  5.         Set Rng = .Find(What:="*", After:=.Cells(1), SearchDirection:=xlPrevious)
  6.         'SearchDirection:=xlPrevious 搜尋方向:往後
  7.     End With
  8.     If Not Rng Is Nothing Then MsgBox Rng.Row
  9. End Sub
複製代碼
感恩的心......(在麻辣家族討論區.用心學習會有進步的)
但資源無限,後援有限,  一天1元的贊助,人人有能力.

TOP

        靜思自在 : 時時好心就是時時好日。
返回列表 上一主題