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

Sub 스페셜셀즈()

'방법1)
    Dim rng As Range
    Set rng = Range("a1").CurrentRegion
    rng.SpecialCells(xlCellTypeBlanks).Select
        '빈칸만 선택
    
'방법2)
    Set rng = Range("a1").CurrentRegion
    
    rng.SpecialCells(xlCellTypeBlanks) = "***"
        '빈칸에 모두 *** 입력
        
'방법3)
    Set rng = Range("a1").CurrentRegion
    
    rng.SpecialCells(xlCellTypeFormulas, xlErrors).Select
                    '에러 있는 수식     (따로 외울것)

'방법4)
    Set rng = Range("a1").CurrentRegion
    
    rng.SpecialCells(xlCellTypeFormulas, xlErrors) = ""
                    '오류 삭제
                    
'방법5)
    On Error Resume Next
        '이 명령문 이후부터는
        '에러 발생시 다음으로 계속 진행함
        'SpecialCells와 함께 사용
        
    rng.SpecialCells(xlCellTypeFormulas).Select
            '수식이 있는 셀만 선택
                
    If Err Then MsgBox "시트 전체에 수식이 하나도 없습니다."
        'On Error Resume Next와 함께 사용

    On Error GoTo 0
        '이 명령문 이후부터는
        '에러 발생시 다시 에러를 표현한다!!
        '디버깅에 이용가능!!

End Sub
320x100

+ Recent posts