땡큐엑셀vba & 엑셀매크로

'작성자 : 땡큐엑셀vba & 엑셀매크로
'목 적
'1) 셀값을 삭제해 봅니다.
'2) 셀을 밀면서(Shift) 삭제해 봅니다.
'셀값 삭제와 Shift하며 삭제하는 방법을 배워봅니다.

Sub 셀삭제_Shift()

    MsgBox "C1,C2,C3셀을 삭제합니다. D,E열이 왼쪽으로 당겨집니다.(ShiftToLeft)"
    Cells(1, "C").Delete shift:=xlShiftToLeft
    Cells(2, "C").Delete shift:=xlShiftToLeft
    Cells(3, "C").Delete shift:=xlShiftToLeft

    MsgBox "A4,B4,C4셀을 삭제합니다. 아래의 셀들이 위로 당겨집니다.(ShiftUp)"
    Cells(4, "a").Delete shift:=xlShiftUp
    Cells(4, "b").Delete shift:=xlShiftUp
    Cells(4, "c").Delete shift:=xlShiftUp

    MsgBox "완료되었습니다", vbInformation, "땡큐엑셀vba & 엑셀매크로"
End Sub



Sub 셀삭제_Shift2()

    MsgBox "C1,C2,C3셀값만을 삭제합니다.", vbInformation, "땡큐엑셀vba & 엑셀매크로"
    Cells(1, "C").ClearContents
    Cells(2, "C").ClearContents
    Cells(3, "C").ClearContents

    MsgBox "C1,C2,C3셀에 값을 입력합니다.", vbInformation, "땡큐엑셀vba & 엑셀매크로"
    Cells(1, "C") = "c"
    Cells(2, "C") = "c"
    Cells(3, "C") = "c"

    MsgBox "C1,C2,C3셀을 삭제합니다. 오른쪽의 셀들이 왼쪽으로 당겨집니다.(ShiftToLeft)", vbInformation, "땡큐엑셀vba & 엑셀매크로"
    Cells(1, "C").Delete shift:=xlShiftToLeft
    Cells(2, "C").Delete shift:=xlShiftToLeft
    Cells(3, "C").Delete shift:=xlShiftToLeft

    MsgBox "완료되었습니다", vbInformation, "땡큐엑셀vba & 엑셀매크로"
    
End Sub

 

셀_삭제(Shift)-땡큐엑셀vba.xlsm
0.02MB