본문 바로가기 메뉴 바로가기

OfficeAutomation

프로필사진
  • 글쓰기
  • 관리
  • 태그
  • 방명록
  • RSS

OfficeAutomation

검색하기 폼
  • 분류 전체보기 (37)
    • VBA (27)
    • Excel (1)
    • VBA CODE (2)
  • 방명록

전체 글 (37)
파일 특정 셀 값 가져오기

Sub GetValueFromAnotherFile() Dim targetPath As String Dim targetWb As Workbook Dim targetValue As Variant ' 속도 향상 및 화면 깜빡임 방지 Application.ScreenUpdating = False Application.DisplayAlerts = False ' 가져올 파일의 전체 경로 지정 (본인의 경로로 수정) targetPath = "C:\Users\USER\Desktop\Test\test.xlsx" ' 다른 파일 열기 Set targetWb = Workbooks.Open(targetPath) ' 특정 시트의 특정 ..

VBA CODE 2026. 5. 21. 02:27
[Excel][VBA] 차트 레이블 추가

Sub DataLabelsFromRange() Dim DLRange As Range Dim Cht As Chart Dim i As Integer, Pts As Integer ' Specify chart Set Cht = ActiveSheet.ChartObjects(1).Chart ' Prompt for a range On Error Resume Next Set DLRange = Application.InputBox _ (prompt:="Range for data labels?", Type:=8) If DLRange Is Nothing Then Exit Sub On Error GoTo 0 ' Add data labels Cht.SeriesCollection(1).ApplyDataLabels _ Type:=..

카테고리 없음 2021. 11. 26. 19:26
[Excel][VBA] 차트 레이블 추가

Sub DataLabelsFromRange() Dim DLRange As Range Dim Cht As Chart Dim i As Integer, Pts As Integer ' Specify chart Set Cht = ActiveSheet.ChartObjects(1).Chart ' Prompt for a range On Error Resume Next Set DLRange = Application.InputBox _ (prompt:="Range for data labels?", Type:=8) If DLRange Is Nothing Then Exit Sub On Error GoTo 0 ' Add data labels Cht.SeriesCollection(1).ApplyDataLabels _ Type:=..

카테고리 없음 2021. 11. 26. 19:15
[Excel][VBA] 차트 원본 데이터 변경

■ 차트의 계열 수식 =SERIES(series_name, category_labels, values, order, sizes) series_name : 범레에 표시되는 계열의 이름이 있는 셀, 범위를 참조 category_labels : 계열의 가로 축이 있는 범위를 참조 values : 계열의 값이 있는 범위를 참조 order : 계열의 순서를 지정하는 정수 sizes : 거품형 차트에만 적용 Sub UpdateChart() Dim ChtObj As ChartObject Dim UserRow As Long Set ChtObj = ActiveSheet.ChartObjects(1) UserRow = ActiveCell.Row If UserRow

카테고리 없음 2021. 11. 26. 19:01
[Excel][VBA] 차트 서식변경

■ 차트서식 넣기 Sub FormatAChart() If ActiveChart Is Nothing Then MsgBox "Activate a chart" Exit Sub End If With ActiveChart .ChartType = xlColumnClustered .ApplyLayout 10 .ChartStyle = 30 .SetElement msoElementPrimaryValueGridLinesNone .ClearToMatchStyle End With End Sub ▶ ChartType : 차트 종류 지정 ▶ ApplyLayout : 차트도구>디자인>차트 레이아웃 ' ApplyLayout 10, xlColumnClustered 로 차트 종류 함께 지정 ▶ ChartStyle : 차트도구>디자인>차..

카테고리 없음 2021. 11. 26. 16:36
[Excel][VBA] 차트 일반작업

■ 차트 종류 - 워크시트에 있는 차트 : 차트로 만들 영역 선택 후 Alt + F1 , 워크시트에 삽입된 차트, 워크시트에 여러 차트가 삽입 된 경우 - 차트 시트 : 차트로 만들 영역 선택 후 F11, 차트 시트에는 차트 하나만 삽입된 경우 ■ 차트 만들기 워크시트 차트 차트시트 Sub aaa() Dim Mychart As Chart Dim DataRange As Range Set DataRange = ActiveSheet.Range("a1:b3") 'worksheet에 차트 생성 Set Mychart = ActiveSheet.Shapes.AddChart.Chart Mychart.SetSourceData Source:=DataRange Mychart.ChartType = xlBarStacked End..

VBA 2021. 11. 26. 14:35
[Excel][VBA] SpecialCells

Range개체.SpecialCells (Type, Value) Type Required XlCellType The cells to include. Value Optional Variant If Type is either xlCellTypeConstants or xlCellTypeFormulas, this argument is used to determine which types of cells to include in the result. These values can be added together to return more than one type. The default is to select all constants or formulas, no matter what the type. ▶ XlCell..

VBA 2021. 11. 25. 15:27
[Excel][VBA] 워크시트의 범위 다루기

범위 복사하기 복사대상.Copy 붙임위치 # 붙임대상의 왼쪽 위 모서리에 붙임 - 범위가 달라도 가능 Sub CopyRang() Dim rng1 As Range, rng2 As Range Set rng1 = Workbooks("통합 문서1").Worksheets("Sheet1").[A1:A10] Set rng2 = Workbooks("통합 문서2").Worksheets("Sheet1").[A1] rng1.Copy rng2 End Sub 범위 옮기기 자르기대상.Copy 붙임위치 # 복사와 동일 형식 rng1.Cut rng2 크기를 모르는 범위 지정 (현재셀이 있는 범위) Range개체.CurrentRegion Range(ActiveCell, ActiveCell.End(방향상수)) rng1.CurrentRe..

VBA 2021. 11. 25. 10:31
이전 1 2 3 4 5 다음
이전 다음
공지사항
최근에 올라온 글
최근에 달린 댓글
Total
Today
Yesterday
링크
TAG
  • function함수 예외
  • 적용 범위
  • 차트 서식변경
  • 함수 재계산
  • WorkSheet Sort
  • Application.InputBox
  • 강제 재계산
  • bubble sort
  • Excel
  • 차트 레이블 추가
  • Option Compare Text
  • 프로시저 호출
  • EnableCancelKey
  • 프로시저 작성 실전
  • 사용자 정의 함수
  • comment.text
  • 배열
  • inputbox
  • 원본 데이터
  • 사용자 정의 함수 재계산
  • ProtectStructure
  • 사용자 정의 함수 사용 예
  • vba
  • Screenupdating
  • 함수 프로시저
  • 개체
  • Function Procesure
  • 참조
  • for each
  • 워크시트 함수 재계산
more
«   2026/09   »
일 월 화 수 목 금 토
1 2 3 4 5
6 7 8 9 10 11 12
13 14 15 16 17 18 19
20 21 22 23 24 25 26
27 28 29 30
글 보관함

Blog is powered by Tistory / Designed by Tistory

티스토리툴바