好吧,我写了这个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它应该找到一个值,并将其放入一个名为apriori的变量中,然后向下放置Offset 26行。
但是,由于某种原因,我不知道宏,而不是,将结果粘贴到目标表中.知道为什么会发生这种事吗?
发布于 2014-05-17 11:35:11
ActiveCell.Offset(26, 0).Copy Worksheets("EXTRACTIONS").Range("B2").Offset(, e).Paste您不需要.Paste在这一行的末尾,您将提供它将粘贴到的目的地。
https://stackoverflow.com/questions/23710815
复制相似问题