ⓒ 2025 AI교육연구회 withseok. All rights reserved. (위드석)
[블로그 글 내용 상업적 이용금지] 위드석홈 | 위드석개발 | AI교육연구회

엑사남 6강 Study

조건표를 이용하여 원하는 서식으로 바꾸기

Sub 성별과점수판단()

Dim i As Long

    With Range("b7").CurrentRegion
            '반복되는 구문은 with사용하여
            '가독성 높임. 아래는 서식 초기화.
        .Interior.ColorIndex = 0
        .Font.ColorIndex = 0
        .Font.Bold = 0
        .Font.Italic = 0
    End With
    
    For i = 8 To Range("j5")
        If Range("d" & i) = Range("j2") And _
            Range("e" & i) <= Range("j3") Then
            Range("j4").Copy
            Range("b" & i).Resize(1, 4).PasteSpecial xlFormats
                '유의 페이스트스페셜과 엑셀포맷츠 사이에 쩜이 없음
        End If
    Next i
Application.CutCopyMode = False '카피 영역 취소
Range("a1").Select
End Sub
엑셀 파일 다운로드

CurrentRegion, With, Resize, PasteSpecial, xlFormats, interior.colorIndex, Font.colorIndex, cutcopymode.xlsm
0.04MB

320x100

+ Recent posts