-1
每個工作表具有標題,其範圍爲「G3:J3」追加片頁眉/標題每個搜索結果
我想這個數據追加到每個搜索結果知道哪些元件屬於哪個表。
循環看起來像這樣的搜索:
Set rFound = .Find(What:=strName, LookIn:=xlValues, LookAt:=xlWhole)
If Not rFound Is Nothing Then
firstAddress = rFound.Address
Do
rFound.EntireRow.Cells(1, "B").Resize(1, 4).Copy
OutputWs.Cells(lastRow + 1, 11).PasteSpecial xlPasteAll
Application.CutCopyMode = False
lastRow = lastRow + 1
Set rFound = .FindNext(rFound)
Loop While Not rFound Is Nothing And rFound.Address <> firstAddress
如何擴展的代碼追加頭數據,以每個搜索結果是在其中標題是頁面下找到?
@DirkReichel,對不起,但「標題」就像每張紙上的標題,它包含nr,名稱,所有者和容量。我想在摘要頁面上的每個搜索結果後面粘貼這些內容。 類似結果: 'Range(「G3:J3」)。複製 表(「彙總」)。範圍(「O」&lastRow).PasteSpecial xlPasteValues' –
不會工作嗎?你的'Range(「G3:J3」)。複製表格(「Summary」)。範圍(「O」&lastRow).PasteSpecial xlPasteValues'對我來說看起來OK –
@DirkReichel nope,粘貼空白區域。在將rFound設置爲.FindNext之前,我在Do循環中插入了代碼 –