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
번호 분류 제목 날짜 조회 수
337 WindowsTip TCP/IP Network Communication without extra Tools(DB, 메신저 등등) 2012.07.03 6775
336 컴퓨터잡담 TCP View로 네트워크 트래픽 유발 프로그램 찾아내기 file 2012.10.18 6064
335 컴퓨터잡담 tasklist /SVC svchost 시스템 서비스 프로세스 보기 2010.01.21 8117
334 컴퓨터잡담 Table_open_cache 가 늘어나지 않는 이유. 1 3 2010.04.27 15544
333 WindowsTip SysFader: iexplore.exe - 응용 프로그램 오류 해결방법 1 file 2013.02.23 12362
332 컴퓨터잡담 svchost.exe 프로세스로 내컴퓨터 최적화 시키기 2010.04.14 7367
331 WindowsTip SVCHOST.EXE 꼭 필요한 servies.msc 항목 1 file 2013.03.20 8811
330 컴퓨터잡담 svchost.exe cpu,memory 점유 문제 해결 4 2011.01.26 6477
329 컴퓨터잡담 SVCHOST 바이러스 제거하기 2 2012.12.24 6411
328 컴퓨터잡담 Spy & Capture Spy++과 같은 계열의 프로그램 1 2009.12.10 17416
327 프로세스 Spoo1sv.exe 바이러스 치료하기 1 12 2011.11.28 19182
326 프로세스 smas.exe 프로세스 내용 및 삭제 1 2011.02.06 13308
325 프로세스 SmartTray.exe 삭제방법 2011.02.13 15676
324 컴퓨터잡담 SK브로드밴드 윈도우7 또는 Vista 속도이상시 환경설정방법 2011.06.20 8374
323 컴퓨터잡담 Sitemap.xml 만들어 주는 사이트 file 2016.01.23 691
322 Server Server 성능 테스트 secret 2016.11.30 585
321 컴퓨터잡담 SendMessage the values are for wparam 1 2009.12.23 8204
320 프로세스 Searchindexer.exe 제거하기 1 2011.03.18 27263
319 컴퓨터잡담 schtasks 예약된 작업의 스케쥴 3 2011.12.14 10432
318 프로세스 SBoxSearchBar 프로세스 삭제방법 1 2011.02.13 15526
Board Pagination Prev 1 ... 28 29 30 31 32 ... 46 Next
/ 46

http://urin79.com

우린친구블로그

sketchbook5, 스케치북5

sketchbook5, 스케치북5

나눔글꼴 설치 안내


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

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

설치 취소