메인 컨텐츠로 가기

Excel의 차트 또는 그래프에서 데이터를 추출하는 방법은 무엇입니까?

문서 추출 차트 데이터 1
Excel에서는 일반적으로 차트를 사용하여 데이터와 추세를보다 명확하게 표시하지만 때로는 차트가 복사본이고 아래 스크린 샷과 같이 차트의 원본 데이터가 없을 수 있습니다. 이 경우이 차트에서 데이터를 추출 할 수 있습니다. 이제이 자습서에서는 차트 또는 그래프에서 데이터를 추출하는 방법에 대해 설명합니다.
VBA로 차트에서 데이터 추출

화살표 블루 오른쪽 거품 VBA로 차트에서 데이터 추출

1. 새 워크 시트를 만들고 이름을 다음과 같이 변경해야합니다. 차트 데이터. 스크린 샷보기 :

문서 추출 차트 데이터 5

2. 그런 다음 데이터를 추출 할 차트를 선택하고 Alt + F11 동시에 키 및 응용 프로그램 용 Microsoft Visual Basic 창이 나타납니다.

3. 클릭 끼워 넣다 > 모듈, 그런 다음 VBA 코드 아래에 붙여 넣습니다. 모듈 창.

VBA : 차트에서 데이터를 추출합니다.

Sub GetChartValues()
    'Updateby20220510
    Dim xNum As Integer
    Dim xSeries As Object
    On Error Resume Next
    xCount = 2
    xNum = UBound(Application.ActiveChart.SeriesCollection(1).Values)
    Application.Worksheets("ChartData").Cells(1, 1) = "X Values"
    With Application.Worksheets("ChartData")
        .Range(.Cells(2, 1), _
        .Cells(xNum + 1, 1)) = _
        Application.Transpose(ActiveChart.SeriesCollection(1).XValues)
    End With
    For Each xSeries In Application.ActiveChart.SeriesCollection
        Application.Worksheets("ChartData").Cells(1, xCount) = xSeries.Name
        With Application.Worksheets("ChartData")
            .Range(.Cells(2, xCount), _
            .Cells(xNum + 1, xCount)) = _
            Application.WorksheetFunction.Transpose(xSeries.Values)
        End With
        xCount = xCount + 1
    Next
End Sub

4. 그런 다음 달리기 버튼을 눌러 VBA를 실행합니다. 스크린 샷보기 :

문서 추출 차트 데이터 2

그런 다음 데이터가 추출 된 것을 볼 수 있습니다. 차트 데이터 시트.
문서 추출 차트 데이터 3

팁 :

1. 필요에 따라 셀 서식을 지정할 수 있습니다.

문서 추출 차트 데이터 4

2. 선택한 차트의 데이터는 기본적으로 ChartData 시트의 첫 번째 셀로 추출됩니다.


팁 : 일반적으로 Excel에서 복잡한 차트를 사용하는 경우 매우 시간이 많이 걸리므로 복잡 할 것입니다. 자동 텍스트 도구 Excel 용 Kutools, 처음에 차트를 만든 다음 상용구 창에 차트를 추가 한 다음 언제 어디서나 다시 사용할 수 있습니다. 실제 필요에 맞게 참조를 변경하기 만하면됩니다.  지금 무료로 다운로드하려면 클릭하십시오..
문서 조건부 서식 누적 막대 차트 12

최고의 사무 생산성 도구

🤖 Kutools AI 보좌관: 다음을 기반으로 데이터 분석을 혁신합니다. 지능형 실행   |  코드 생성  |  사용자 정의 수식 만들기  |  데이터 분석 및 차트 생성  |  Kutools 기능 호출...
인기 기능: 중복 항목 찾기, 강조 표시 또는 식별   |  빈 행 삭제   |  데이터 손실 없이 열이나 셀 결합   |   수식없이 반올림 ...
슈퍼 조회: 다중 기준 VLookup    다중 값 VLookup  |   여러 시트에 걸친 VLookup   |   퍼지 조회 ....
고급 드롭다운 목록: 드롭다운 목록을 빠르게 생성   |  종속 드롭다운 목록   |  다중 선택 드롭 다운 목록 ....
열 관리자: 특정 개수의 열 추가  |  열 이동  |  Toggle 숨겨진 열의 가시성 상태  |  범위 및 열 비교 ...
특색 지어진 특징: 그리드 포커스   |  디자인보기   |   큰 수식 바    통합 문서 및 시트 관리자   |  리소스 라이브러리 (자동 텍스트)   |  날짜 선택기   |  워크 시트 결합   |  셀 암호화/해독    목록으로 이메일 보내기   |  슈퍼 필터   |   특수 필터 (굵게/기울임꼴/취소선 필터링...) ...
상위 15개 도구 세트12 본문 도구 (텍스트 추가, 문자 제거,...)   |   50+ 거래차트 유형 (Gantt 차트,...)   |   40+ 실용 방식 (생일을 기준으로 나이 계산,...)   |   19 삽입 도구 (QR 코드 삽입, 경로에서 그림 삽입,...)   |   12 매출 상승 도구 (숫자를 단어로, 환율,...)   |   7 병합 및 분할 도구 (고급 결합 행, 셀 분할,...)   |   ... 그리고 더

Excel용 Kutools로 Excel 기술을 강화하고 이전과는 전혀 다른 효율성을 경험해 보세요. Excel용 Kutools는 생산성을 높이고 시간을 절약하기 위해 300개 이상의 고급 기능을 제공합니다.  가장 필요한 기능을 얻으려면 여기를 클릭하십시오...

상품 설명


Office Tab은 Office에 탭 인터페이스를 제공하여 작업을 훨씬 쉽게 만듭니다.

  • Word, Excel, PowerPoint에서 탭 편집 및 읽기 사용, Publisher, Access, Visio 및 Project.
  • 새 창이 아닌 동일한 창의 새 탭에서 여러 문서를 열고 만듭니다.
  • 생산성을 50% 높이고 매일 수백 번의 마우스 클릭을 줄입니다!
Comments (18)
No ratings yet. Be the first to rate!
This comment was minimized by the moderator on the site
Amazing...
This comment was minimized by the moderator on the site
Very helpful! Thanks a lot!
This comment was minimized by the moderator on the site
giving error and tell to set block variables and object variables
This comment was minimized by the moderator on the site
Hi, I have updated the VBA, you can try it again.
This comment was minimized by the moderator on the site
i tried above & it says "Compile error: Method or Data Member not found"
This comment was minimized by the moderator on the site
mong mọi người giúp đỡ làm cách nào để lấy số liệu từ biểu đồ này với ạ!
This comment was minimized by the moderator on the site
i m getting below error while running that command.
this error comes in that command which starts from xnum = UBound(......) etc

Run-Time error '91'
object variable or with block variable not set
This comment was minimized by the moderator on the site
Hi, tarshul, you need to create a new worksheet named ChartData before you running the code, the data will be place in the new worksheet ChartData.
This comment was minimized by the moderator on the site
Hi sunny,
I already create new worksheet as u told but still getting same error.
This comment was minimized by the moderator on the site
This doesn't appear to work for a scatter plot as it only extracts one set of "x" data. How can I amend it to extract all "x" data sets?
This comment was minimized by the moderator on the site
Sorry I did not found the solution about that.
This comment was minimized by the moderator on the site
i've tried with a scatter plot graph as well, but only get one line of valor.


i need so much to find a way to extract data from scatterplot graphs.
This comment was minimized by the moderator on the site
I failed to get the prices of a fund chart on my mac excel 2011 . Run time error '91' object variable or block variable not set . Don't know how to debug . Appreciate any help .
This comment was minimized by the moderator on the site
Very useful and perfect
This comment was minimized by the moderator on the site
gives me values that i created chart with not all the values in range
This comment was minimized by the moderator on the site
Amazing command, thanks a lot! I used it with a pivot chart and it works!
There are no comments posted here yet
Load More
Please leave your comments in English
Posting as Guest
×
Rate this post:
0   Characters
Suggested Locations