Skip to content
조회 수 16349 추천 수 0 댓글 0
?

단축키

Prev이전 문서

Next다음 문서

크게 작게 위로 아래로 댓글로 가기 인쇄
?

단축키

Prev이전 문서

Next다음 문서

크게 작게 위로 아래로 댓글로 가기 인쇄


 Excel VBA) Delete Column Excel VBA - 칼럼 지우기


To delete column in Excel VBA you can first run this Sub to enter data into a spreadsheet if you are starting with a blank workbook.

Sub Mulptiplication_Table()
Range("A1").Select
ActiveCell.FormulaR1C1 = "1"
Range("B1").Select
ActiveCell.FormulaR1C1 = "2"
Range("A1:B1").Select
Selection.AutoFill Destination:=Range("A1:J1"), Type:=xlFillDefault
Range("A1:J1").Select
Range("A2").Select
ActiveCell.FormulaR1C1 = "2"
Range("A1:A2").Select
Selection.AutoFill Destination:=Range("A1:A10"), Type:=xlFillDefault
Range("A1:A10").Select
Range("B2").Select
ActiveCell.FormulaR1C1 = "=R[-1]C*RC[-1]"
Range("B2").Select
Selection.AutoFill Destination:=Range("B2:C2"), Type:=xlFillDefault
Range("B2:C2").Select
Range("B2").Select
ActiveCell.FormulaR1C1 = "=R1C*RC1"
Range("B2").Select
Selection.AutoFill Destination:=Range("B2:J2"), Type:=xlFillDefault
Range("B2:J2").Select
Selection.AutoFill Destination:=Range("B2:J10"), Type:=xlFillDefault
Range("B2:J10").Select
End Sub
In the following Sub, you can use either Columns("F:F") or Columns(3) depending on the column you want to delete. The Columns property takes a Range or a numerical value.
Sub Delete_Column_Excel_VBA()
Columns("F:F").Select
Selection.Delete Shift:=xlToLeft
End Sub
The Rows property also takes a Range or a numerical value.
Sub Delete_Row_Excel_VBA()
Rows("7:7").Select
Selection.Delete Shift:=xlUp
End Sub
In both the above examples of Selection.Delete, you do not need the "Shift:=" xlToLeft or xlUp since you are deleting a whole Row or Column. If you were deleting a Range of cells that are not a whole Row or Column you would want to specify from which direction you want the cells to move from with xlToLeft, xlToRight, xlUp, and xlDown. 

로그인 후 댓글쓰기가 가능합니다.

?

List of Articles
번호 분류 제목 날짜 조회 수
597 프로세스 CKAgent.exe npkcmsvc.exe nvsvc32.exe 1 2011.02.07 13218
596 컴퓨터잡담 AHK & my Address of Pointer and my Offset 2011.10.11 13183
595 컴퓨터잡담 MySQL을 위한 하드웨어 최적화(What one can and should optimize) 2 2010.04.06 13123
594 Server mysql 실행이 안되거나 테이블(사용중) 손상이 잃어난 경우 2 2012.07.14 13083
593 컴퓨터잡담 safeout.exe 프로세스 삭제하기 3 2012.03.12 13032
592 WindowsTip 윈도우 레지스트리 설정 - 인터넷 익스플로러 4 2013.02.28 12950
591 [Docs]스프레드시트 Google SpeadSheet 조건에 맞는 데이터만 참조하여 가져오기(importrange, Query) 1 file 2016.08.06 12947
590 Server php) curl_setopt의 옵션 1 10 2013.04.02 12938
589 컴퓨터잡담 [아파치] Disabled use of AcceptEx() winsock2 API 라고 나오는 경우 2 2010.11.28 12901
588 HTMLPHPMSQL 자바스크립트 명령어 2018.01.31 12894
587 컴퓨터잡담 맥변조 현상에 따른 조치방법(arp -a 실시간 감시) 2 20 file 2011.12.22 12763
586 컴퓨터잡담 Implementation of the MetaWeblog API http://www.xmlrpc.com/metaWeblogApi in php 2010.07.12 12760
585 컴퓨터잡담 무서운 후킹프로세스들~ 방어방법 1 2 2010.02.20 12736
584 AutoHotKey 부팅완료 메시지 프로그램 file 2011.12.17 12719
583 컴퓨터잡담 엑셀 VBA) Shell로 외부프로그램 호출 2011.11.07 12701
582 컴퓨터잡담 jQuery 강좌 3 2009.10.27 12630
581 컴퓨터잡담 [악성코드퇴치] fph.exe 프로세서 제거하기 1 2010.08.11 12594
580 Excel 엑셀 RANK 함수의 낮은자리부터 순위매김 2012.03.26 12582
579 컴퓨터잡담 [REMIX OS]How to Edit of REMIX OS build.prop? 수정방법 file 2019.11.10 12579
578 컴퓨터잡담 [윈도우7] 이 컴퓨터는 정품 Windows를 사용하고 있지 않습니다 해결방법 1 2011.09.12 12540
Board Pagination Prev 1 ... 15 16 17 18 19 ... 46 Next
/ 46

http://urin79.com

우린친구블로그

sketchbook5, 스케치북5

sketchbook5, 스케치북5

나눔글꼴 설치 안내


이 PC에는 나눔글꼴이 설치되어 있지 않습니다.

이 사이트를 나눔글꼴로 보기 위해서는
나눔글꼴을 설치해야 합니다.

설치 취소