//서식복사
Sub formatCopy()
Range("f3:L3").Copy
Range("f7:L" & Range("b2")).PasteSpecial xlPasteFormats
Range("f6").Select
Application.CutCopyMode = False
End Sub
■ 키포인트
항상 같이 쓰이는 것들.
for next
if then end if
Sub manWomen()
Dim i As Long
With Range("f8").CurrentRegion
.Interior.ColorIndex = 0
.Font.ColorIndex = 0
End With
For i = 9 To Range("b2")
If Range("g" & i) = Range("b3") And _
Range("h" & i) <= Range("b4") Then
Range("b5").Copy
Range("f" & i).Resize(1, 3).PasteSpecial xlFormats
End If
Next
End Sub
//전체복사
Sub copyPaste()
Range("o6").CurrentRegion.Clear
Range("f6:L10").Copy
Range("o6").PasteSpecial
Range("f6").Select
Application.CutCopyMode = False
End Sub
//값복사
Sub valpaste()
Range("f6").CurrentRegion.Copy
Range("o6").PasteSpecial xlPasteValues
Range("f6").Select
Application.CutCopyMode = False
End Sub
수식만 복사 (함수)
Sub numPaste()
Range("k3:L3").Copy
Range("k7:L" & Range("b2")).PasteSpecial xlPasteFormulas
Range("f6").Select
Application.CutCopyMode = False
End Sub
'Excel - VBA' 카테고리의 다른 글
엑셀 VBA 코드 정리 (0) | 2020.07.27 |
---|
댓글