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. 11
    Sep 2010
    10:33

    Windows Movie Maker 2.1 다운로드

    Category컴퓨터잡담 Views22457
    Read More
  2. 13
    Nov 2009
    17:43

    MYSQL 최적화

    Category컴퓨터잡담 Views22447
    Read More
  3. 19
    May 2013
    13:20

    인터넷 익스플로러 개발자도구 해제 시키는 방법

    Category컴퓨터잡담 Views22398
    Read More
  4. 05
    Dec 2010
    08:14

    c 와 c++ 의 차이점

    CategoryVisual C++ Views22340
    Read More
  5. 13
    Feb 2012
    13:33

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

    CategoryExcel Views22229
    Read More
  6. 25
    Nov 2009
    08:16

    windows error 코드표

    Category컴퓨터잡담 Views22197
    Read More
  7. 24
    May 2013
    07:53

    php) 엑셀로 저장하기

    CategoryServer Views22064
    Read More
  8. 04
    May 2010
    13:16

    [해킹차단]이런창이 뜨는 사이트들 정말 조심하길 바란다.

    Category컴퓨터잡담 Views22036
    Read More
  9. 14
    Jun 2013
    08:36

    An error [-5001 : 0x80070002] ha occurred while running the setup 오류 해결방법

    CategoryWindowsTip Views21935
    Read More
  10. 28
    Feb 2013
    10:24

    PHP) Proxy 서버를 이용해서 원격 웹서버 내용 갖고 오기

    CategoryVisual C++ Views21868
    Read More
  11. 17
    Oct 2011
    19:07

    Excel VBA) 자주쓰는 함수모음

    Category컴퓨터잡담 Views21676
    Read More
  12. 13
    Feb 2011
    21:36

    NVSvc.exe 프로세스 삭제방법

    Category프로세스 Views21651
    Read More
  13. 14
    Feb 2011
    17:29

    AutoHotkey_L: Arrays, Debugger, x64, COM, #If expression

    CategoryAutoHotKey Views21594
    Read More
  14. 04
    Dec 2009
    09:53

    주키(Primary Key, 프라이머리키)와 자동 증가(Auto Increment) 필드

    Category컴퓨터잡담 Views21562
    Read More
  15. 23
    Sep 2011
    18:24

    VBA를 이용한 엑셀 프로그래밍

    Category컴퓨터잡담 Views21508
    Read More
  16. 21
    Sep 2022
    12:54

    지존오토 메뉴얼 익스트림 화면 분석기(여러 개의 순환구조)

    Category컴퓨터잡담 Views21496
    Read More
  17. 08
    May 2022
    08:40

    파이썬 파이인스톨러 설치하기

    Category파이썬 Views21421
    Read More
  18. 11
    Jul 2010
    22:07

    AutohotKey Postmessage(SendMessage)로 CTRL+C 전송하기

    Category컴퓨터잡담 Views21413
    Read More
  19. 10
    Feb 2011
    23:52

    IE.ahk COM 환상강의

    CategoryAutoHotKey Views21252
    Read More
  20. 06
    Aug 2009
    15:11

    PHP 시간관련 함수

    Category컴퓨터잡담 Views21208
    Read More
Board Pagination Prev 1 ... 5 6 7 8 9 ... 46 Next
/ 46

http://urin79.com

우린친구블로그

sketchbook5, 스케치북5

sketchbook5, 스케치북5

나눔글꼴 설치 안내


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

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

설치 취소