수동 처리를 대체하기 위해 쓰는 VBA 코드에 문제가 있습니다.필터링 된 데이터의 1 열을 다른 시트로 복사
거의 끝까지 다되었지만 필자의 필터링 된 데이터를 열 기준으로 새 시트에 복사하는 데 어려움을 겪고 있습니다 (레이아웃이 새 시트에서 변경됨). 현재 가지고있는 코드는 셀 C2의 데이터 만 복사하는 것입니다.
아무에게도 이것을보고 내가 잘못 본 곳을 볼 수 있습니까? 아래 코드의 관련 부분을 복사했습니다.
미리 감사
'Copy formula down
Range("F2:L2").Select
Selection.Copy
LR = Range("A" & Rows.Count).End(xlUp).Row
Range("F2:L2").AutoFill Destination:=Range("F2:L" & LR), Type:=xlFillDefault
Application.CutCopyMode = False
Range("O1").goalseek Goal:=Range("Q1"), ChangingCell:=Range("U1")
'Add Filter
Range("A2").Select
Selection.AutoFilter
ActiveSheet.Range("$A$1:$L$5000").AutoFilter Field:=12, Criteria1:= _
"1"
'Move the data to the new sheet
Sheets("Sheet1").Select
LR = Range("A" & Rows.Count).End(xlUp).Row
NextFree = Range("A2:A" & Rows.Count).Cells.SpecialCells(xlCellTypeBlanks).Row
Range("A" & NextFree).Select
Range("A" & NextFree).SpecialCells(xlCellTypeVisible).Value2 = _
Worksheets("To Be Used").Range("C:C").SpecialCells(xlCellTypeVisible).Value2
'This part is only copying the data from cell C2 when I need it to copy all of the filtered data in column C aprt from C1 and there is a long delay
Range("A" & NextFree).SpecialCells(xlCellTypeVisible).Value2 = _
Worksheets("To Be Used").Range("C2:C" & LR).SpecialCells(xlCellTypeVisible).Value2
하이 난 그냥 두 번 코드의 일부를 입력 한 실현, 하단에있는 부분은 나는 이것이 작동 –