1
일부 열의 값을 다른 시트로 복사하고 복사 할 수있는 방법이 있습니까?Visual Basic-Excel 일부 시트 만 다른 시트로 복사
이 사진은 더 설명 할 것입니다 : 알고 여기
내 코드이지만 내가 그나마 약간의 오차가 이유 :
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Sheets("SheetB").Select
' Find the last row of data
FinalRow = Cells(Rows.Count, 1).End(xlUp).Row
' Loop through each row
For x = 1 To FinalRow
' Decide if to copy based on column A in sheetB
ThisValue = Cells(x, 1).Value
If ThisValue = Target.Value Then
Cells(x, 1).Resize(1, 33).Copy
Sheets("SheetC").Select
NextRow = Cells(Rows.Count, 1).End(xlUp).Row + 1
Cells(NextRow, 1).Select
ActiveSheet.Paste
Sheets("SheetB").Select
End If
Next x
End Sub