땡큐엑셀vba & 엑셀매크로

'작성자 : 땡큐엑셀vba & 엑셀매크로
'목 적
'1) 셀을 삽입(Shift)해 봅니다.
'2) 셀을 삭제(Shift)해 봅니다.
'3) 셀의 삽입과 삭제에 대해 알아봅니다.


Sub 셀삽입()

    MsgBox "C1,C2,C3셀을 오른쪽으로 밀며 삽입합니다.", vbInformation, "땡큐엑셀vba & 엑셀매크로"
    Cells(1, "C").Insert shift:=xlShiftToRight
    Cells(2, "C").Insert shift:=xlShiftToRight
    Cells(3, "C").Insert shift:=xlShiftToRight

    MsgBox "A4,B4,C4셀을 아래로 밀며 삽입합니다.", vbInformation, "땡큐엑셀vba & 엑셀매크로"
    Cells(4, "a").Insert shift:=xlShiftDown
    Cells(4, "b").Insert shift:=xlShiftDown
    Cells(4, "c").Insert shift:=xlShiftDown

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



Sub 셀삽입2()

    MsgBox "C1,C2,C3셀을 오른쪽으로 밀며 삽입합니다.", vbInformation, "땡큐엑셀vba & 엑셀매크로"
    Cells(1, "C").Insert shift:=xlShiftToRight
    Cells(2, "C").Insert shift:=xlShiftToRight
    Cells(3, "C").Insert shift:=xlShiftToRight

    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 "A4,B4,C4셀을 아래로 밀며 삽입합니다.", vbInformation, "땡큐엑셀vba & 엑셀매크로"
    Cells(4, "a").Insert shift:=xlShiftDown
    Cells(4, "b").Insert shift:=xlShiftDown
    Cells(4, "c").Insert shift:=xlShiftDown

    MsgBox "A4,B4,C4셀을 삭제합니다. 아래에 있는 셀이 당겨집니다. (ShiftUp)", vbInformation, "땡큐엑셀vba & 엑셀매크로"
    Cells(4, "a").Delete shift:=xlShiftUp
    Cells(4, "b").Delete shift:=xlShiftUp
    Cells(4, "c").Delete shift:=xlShiftUp


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

 

셀_삽입(Shift)-땡큐엑셀vba.xlsm
0.02MB