返回列表 上一主題 發帖

(已解決)如何用搜尋找資料後複製該位置以下的資料?

回復 10# hugh0620
  1. r = Application.Match(a, .[A:A], 0)
  2.      If IsNumeric(r) And Not c Is Nothing Then a.Offset(, 2) = .Cells(r, c.Column) Else a.Offset(, 2) = ""
複製代碼

Match函數 :找到時傳回數字, 找不到時傳回 "#N/A" (錯誤值)
改成 If   Not IsError(r)  And Not c Is Nothing Then  就可以除錯

TOP

        靜思自在 : 【時間成就一切】時間可以造就人格,可以成就事業,也可以儲積功德。
返回列表 上一主題