매크로에 문제가 있습니다. 하나의 시트 (A)에서 실행하고 시트 (B)에서 셀을 복사하여 시트 (C)에 붙여 넣어야합니다. 하지만 나는 시트를 변경시킬 수만 있습니다. 시트를 활성화시키지 않고 할 수있는 방법이 있습니까 ???활성화 시트를 사용하지 않고 붙여 넣기 대상을 복사하는 방법
내 매크로 : 내가 Range.Copy 명령을 찾을 수 위의 링크 된 질문에
enter code here
Sub VPL()
Dim j As Long, i As Long
For j = 1 To 9
' COPIAR/COLAR GERAÇÃO
' How to do this without activate sheets "Geração" and "Premissas"????
Sheets("Geração").Activate
ActiveSheet.Range(Cells(20, 2 + j), Cells(31, 2 + j)).Select
Selection.Copy
Sheets("Premissas").Activate
ActiveSheet.Range("Z20:AI31").Select
Selection.PasteSpecial Paste:=xlPasteValues, _
Operation:=xlNone, _
SkipBlanks:=False, _
Transpose:=False
Sheets("Premissas").Activate
ActiveSheet.Range("AL20:AL31").Select
Selection.PasteSpecial Paste:=xlPasteValues, _
Operation:=xlNone, _
SkipBlanks:=False, _
Transpose:=False
' COPIAR/COLAR PLD
For i = 1 To 2000
'The same problem here.
Sheets("PLD NE").Activate
ActiveSheet.Range(Cells(1 + i, 1), Cells(1 + i, 60)).Select
Selection.Copy
Sheets("Macro").Activate
ActiveSheet.Range("AZ27").Select
Selection.PasteSpecial Paste:=xlPasteValues, _
Operation:=xlNone, _
SkipBlanks:=False, _
Transpose:=False
'COPIAR/COLAR VPL
'The macro runs form Sheets("RESULTADO LEN") and I want only to be on this sheet.
Sheets("RESULTADO LEN").Activate
Sheets(10).Cells(3 + i, 2 + j) = Sheets(5).Cells(35, 4).Value 'Ametista
Sheets(10).Cells(3 + i, 11 + j) = Sheets(5).Cells(62, 4).Value 'Borgo
Sheets(10).Cells(3 + i, 20 + j) = Sheets(5).Cells(89, 4).Value 'Caitite
Sheets(10).Cells(3 + i, 29 + j) = Sheets(5).Cells(116, 4).Value 'Dourados
Sheets(10).Cells(3 + i, 38 + j) = Sheets(5).Cells(143, 4).Value 'Espigão
Sheets(10).Cells(3 + i, 47 + j) = Sheets(5).Cells(170, 4).Value 'Maron
Sheets(10).Cells(3 + i, 56 + j) = Sheets(5).Cells(197, 4).Value 'Pelourinho
Sheets(10).Cells(3 + i, 65 + j) = Sheets(5).Cells(224, 4).Value 'Pilões
Sheets(10).Cells(3 + i, 74 + j) = Sheets(5).Cells(251, 4).Value 'Serra do espigão
Sheets(10).Cells(3 + i, 83 + j) = Sheets(6).Cells(36, 4).Value 'São Salvador
Next
Next
End Sub