- 帖子
- 552
- 主題
- 6
- 精華
- 0
- 積分
- 576
- 點名
- 0
- 作業系統
- win7
- 軟體版本
- office 2010
- 閱讀權限
- 50
- 性別
- 男
- 註冊時間
- 2015-2-8
- 最後登錄
- 2026-9-10
  
|
回復 1# Scott090
尋找<=某值不一定要用.Find,方法有很多下面說明則是利用VBA,Find的說明範例修改的給你參考- Public Sub Find_1()
- A = 5
- N = 1
- With Worksheets(1).Range("a1:a" & Cells(Rows.Count, "a").End(xlUp).Row)
- Set c = .Find("*", LookIn:=xlValues, SearchDirection:=2)
- If Not c Is Nothing Then
- firstAddress = c.Address
- Do
- If c <= A Then
- Cells(N, "D") = c.Value
- N = N + 1
- End If
- Set c = .FindNext(c)
- Loop While Not c Is Nothing And c.Address <> firstAddress
- End If
- End With
- End Sub
複製代碼 |
|