[땡큐엑셀vba & 엑셀매크로] 셀삽입과 삭제
엑셀vba & 엑셀매크로2020. 6. 27. 00:00
'작성자 : 땡큐엑셀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
'엑셀vba & 엑셀매크로' 카테고리의 다른 글
[땡큐엑셀vba & 엑셀매크로] 셀의 글자크기 바꾸기 (0) | 2020.06.29 |
---|---|
[땡큐엑셀vba & 엑셀매크로] 셀의 글꼴 변경 (0) | 2020.06.28 |
[땡큐엑셀vba & 엑셀매크로] 셀삭제 (Shift) (0) | 2020.06.26 |
[땡큐엑셀vba & 엑셀매크로] 여러시트의 셀에 값입력 (0) | 2020.06.25 |
[땡큐엑셀vba & 엑셀매크로] 셀의 복사(copy)와 이동(cut) (0) | 2020.06.24 |