返回列表 上一主題 發帖

[發問] 如何把EXCEL SHEEP中的內容當資料庫,搜尋後再丟至要的分頁中?

  1. Sub yy()
  2.     Dim c As Range, i%
  3.     With Sheet1
  4.         For i = 2 To .[a65536].End(3).Row
  5.             Set c = Sheet2.[a:a].Find(.Cells(i, 2))
  6.             If Not c Is Nothing Then
  7.                 .Cells(i, 3).Resize(, 2) = c(1, 2).Resize(, 2).Value
  8.             End If
  9.             Set c = Sheet3.[a:a].Find(.Cells(i, 1))
  10.             If Not c Is Nothing Then
  11.                 .Cells(i, 5).Resize(, 3) = c(1, 2).Resize(, 3).Value
  12.             End If
  13.         Next
  14.     End With
  15. End Sub
複製代碼

TOP

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