过程不会将值粘贴到目标工作表中

好吧,我写了这个small sub

 Sub dingo() Dim apriori Dim e As Integer Dim n As Integer Dim rr As Integer Dim yolk As Integer Dim timy As Integer 'timy = yeah.Count rr = ActiveWorkbook.Worksheets.Count yolk = rr e = 1 For Each apriori In yeah 'WE NEED LOOP ON THE COPYING MECHANISM!!!-re-test Dim Rng As Range If Trim(apriori) <> "" Then With Sheets(yolk).Range("1:1") Set Rng = .Find(apriori, .Cells(.Cells.Count), xlValues, xlWhole, xlByRows, _ xlNext, False) yolk = yolk - 1 'e = 1 If Not Rng Is Nothing Then Application.Goto Rng, True ActiveCell.Offset(26, 0).Copy Worksheets("EXTRACTIONS").Range("B2").Offset(, e).Paste e = e + 1 Else MsgBox "Nothing found" End If End With End If Next apriori End Sub 

它应该find一个值,并把它放到一个名为apriori的variables,然后Offset 26行。

但是,因为我不知道macros不粘贴结果在目标表….任何想法为什么会发生这种情况?

 ActiveCell.Offset(26, 0).Copy Worksheets("EXTRACTIONS").Range("B2").Offset(, e).Paste 

你不需要.Paste在这一行的末尾,你正在提供将要粘贴的目的地。