Skip to content
컴퓨터잡담
2011.10.17 19:07

Excel VBA) 자주쓰는 함수모음

조회 수 21676 추천 수 0 댓글 0
?

단축키

Prev이전 문서

Next다음 문서

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

단축키

Prev이전 문서

Next다음 문서

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

Excel VBA) 자주쓰는 함수모음

'현재 줄 내용 다음줄에 추가

'선택된 셀의 행 번호를 취득

thisRow = ActiveCell.Row

'복사하고 싶은 대상을 문자열로 편집

address1 = "A" + CStr(thisRow) + ":G" + CStr(thisRow)

'삽입될 범위

address3 = "A" + CStr(thisRow + 1) + ":G" + CStr(thisRow + 1)

Range(address1).Select


'현재 줄 내용 다음줄에 추가

Range("A1").Select

Selection.End(xlDown).Select

ActiveCell.Offset(1, 0).Select





'마지막 행수(비어있는 셀은 포함하지 않음) 예) LValue(B1)

Function LValue(aRange As Range)

     LValue = Range(aRange.Address).End(xlDown).Value

End Function


'값이 있는 마지막 셀의 위치

xlSheet.OlePropertyGet("UsedRange").OlePropertyGet("Rows").OlePropertyGet("Count"); 

xlSheet.OlePropertyGet("UsedRange").OlePropertyGet("Columns").OlePropertyGet("Count"); 

cntrow = WorkSheets(1).UsedRange.Rows.Count

cntcol = WorkSheets(1).UsedRange.Columns.Count


'다음은 특정 행이나 열의 마지막 셀의 위치값을 반환한다.

'두번째 열의 마지막 행 까지의 셀개수를 가져온다

cntRow2 = WorkSheets(1).Cells(Rows.Count, 2).End(xlUp).Row

'두번째 행의 마지막 열 까지의 셀개수를 가져온다.

cntCol2 = WorkSheets(1).Cells(2, Columns.Count).End(xlToRight).Column




'MySheet라는 시트에 셀 2,1(즉, B1)에 값을 입력할 수 있다. 시트 비활성화 상태에서도 가능

Worksheets("MySheet").Cells(2, 1).Value = "VBA Programming"


' 선택된 주소의 인접된 주소값 (기본값 예:$A$1:$B$10), 만약 $를 생략하고 싶을경우

' Selection.Address(0,0)을 입력하면 된다.

Range("A1").CurrentRegion.Select

Selection.Address


' 선택된 범위의 내용지우기

Selection.ClearContents


' 해당 셀에 .Value 값 입력하기

With Range("A1,A3,A5,A7,A9,B2,B4,B6,B8,B10")

    .Select

    .Value = "엑셀 VBA"

End With


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

?

  1. 30
    Oct 2013
    17:04

    ahk) autohotkey 엑셀(Excel)에서 행값 증가시키기

    CategoryAutoHotKey Views37416
    Read More
  2. 09
    Jun 2013
    12:13

    Excel) 엑셀에서 셀 입력시 자동 추가글 넣기

    CategoryExcel Views24062
    Read More
  3. 17
    Sep 2012
    08:21

    현재 Excel 파일 이름을 셀에 삽입

    CategoryExcel Views24559
    Read More
  4. 16
    Jul 2012
    16:20

    [excel] GET.CELL사용법

    CategoryExcel Views26599
    Read More
  5. 30
    Jun 2012
    08:14

    PDF, EXCEL 파일 변환

    CategoryExcel Views19809
    Read More
  6. 13
    Feb 2012
    13:33

    MS Office 2007 Excel 최근 문서 목록 삭제하기

    CategoryExcel Views22229
    Read More
  7. 05
    Jan 2012
    07:01

    Excel Vba) 현재 셀에서 한줄내림 (activecell.offset(1,0).Select)

    CategoryExcel Views31020
    Read More
  8. 05
    Jan 2012
    07:00

    Excel Vba) 셀의 행, 열(column, row) 주소 알아내기 또는 삽입하기 더불어 제어하기

    CategoryExcel Views42974
    Read More
  9. 21
    Dec 2011
    14:36

    Excel) 엑셀 콤보박스 대화상자 목록지정하기

    CategoryExcel Views29390
    Read More
  10. 25
    Nov 2011
    13:03

    Excel VBA) 파일 이름에 따라 이미지 출력

    Category컴퓨터잡담 Views16207
    Read More
  11. 25
    Oct 2011
    19:49

    Excel VBA) 선택값에 따라 결과값 전달하기 CASE문

    Category컴퓨터잡담 Views14771
    Read More
  12. 24
    Oct 2011
    19:01

    Excel VBA (1): 셀 선택 및 변수 및 비활성시트 컨트롤하기

    Category컴퓨터잡담 Views25000
    Read More
  13. 23
    Oct 2011
    12:59

    Excel VBA) DAO를 이용하여 엑셀문서 열지않고 데이타 가져오기

    Category컴퓨터잡담 Views18274
    Read More
  14. 23
    Oct 2011
    08:20

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

    Category컴퓨터잡담 Views16349
    Read More
  15. 23
    Oct 2011
    07:51

    Excel VBA)OpenDatabase 방법 [Excel 2003의 VBA 언어 참조]

    Category컴퓨터잡담 Views13884
    Read More
  16. 23
    Oct 2011
    06:07

    eXCEL VBA)엑셀파일 열지않고 내용 불러오기

    Category컴퓨터잡담 Views30518
    Read More
  17. 17
    Oct 2011
    19:07

    Excel VBA) 자주쓰는 함수모음

    Category컴퓨터잡담 Views21676
    Read More
  18. 14
    Oct 2011
    18:29

    Excel VBA) 엑셀 데이터 범위 찾아내기

    Category컴퓨터잡담 Views15265
    Read More
  19. 14
    Oct 2011
    13:54

    Excel VBA) 원하는 범위 지정한 뒤 복사하여 붙여넣기

    Category컴퓨터잡담 Views29387
    Read More
  20. 28
    Sep 2011
    18:48

    Excel VBA) 자료모으기

    Category컴퓨터잡담 Views11903
    Read More
Board Pagination Prev 1 2 Next
/ 2

http://urin79.com

우린친구블로그

sketchbook5, 스케치북5

sketchbook5, 스케치북5

나눔글꼴 설치 안내


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

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

설치 취소