- 帖子
- 1018
- 主題
- 15
- 精華
- 0
- 積分
- 1058
- 點名
- 0
- 作業系統
- win7 32bit
- 軟體版本
- Office 2016 64-bit
- 閱讀權限
- 50
- 性別
- 男
- 來自
- 桃園
- 註冊時間
- 2012-5-9
- 最後登錄
- 2022-9-28
|
回復 1# zxcxz
可改成這樣,因為c為nothing時無法再判斷c.address- With Worksheets(1).Range("a1:a500")
- Set c = .Find(2, LookIn:=xlValues)
- If Not c Is Nothing Then
- firstAddress = c.Address
- Do
- c.Value = 5
- Set c = .FindNext(c)
- If c Is Nothing Then Exit Do
- Loop While c.Address <> firstAddress
- End If
- End With
複製代碼 |
|