精华内容
下载资源
问答
  • VBA 创建图表

    2012-10-24 10:12:40
    大家好 ...数据源,我想根据这个数据源在myworkbook 对象中生成图表页,不知怎么样用myworkbook和Charts对象,希望大家能够帮忙指教指教 Sub DrawLine(myworkbook As Workbook) todo end sub
  • 可以通过VBA创建的图快速生成折线图,并可适当修改符合自己的要求。
  • 即下载财报到f盘,(此处需手动先打开下载好的文件)选择好要分析的科目,然后贴数据到主页面并生成折线图,可手动挪动图表行改分析的科目,嘻嘻。 以下为两个按钮的代码。 Sub dl() Dim code As String Dim kemu...

    表格界面,填写股票代码后点击“下载报表”。

    即下载财报到f盘,(此处需手动先打开下载好的文件)选择好要分析的科目,然后贴数据到主页面并生成折线图,可手动挪动图表行改分析的科目,嘻嘻。

    以下为两个按钮的代码。

    Sub dl()
    Dim code As String
    Dim kemu As String
    code = Range("j3").Value
    Dim H, S
    Set H = CreateObject("Microsoft.XMLHTTP")
    H.Open "GET", "http://money.finance.sina.com.cn/corp/go.php/vDOWN_BalanceSheet/displaytype/4/stockid/" & code & "/ctrl/all.phtml", False '网络中的文件URL
    H.send
    Set S = CreateObject("ADODB.Stream")
    S.Type = 1
    S.Open
    S.write H.Responsebody
    S.savetofile "f:\" & code & ".xls", 2  '本地保存文件名
    S.Close
    End Sub
    
    Sub Button3_Click()
    '
    ' Button3_Click Macro
    '
    Dim code As String
    Dim kemu As Integer
    Dim id As String
    code = Range("j3").Value
    kemu = Range("g4").Value
    Workbooks("F:\" & code & ".xls").Sheets(code).Range("A1:CQ70").Copy Range("A15")
    id = kemu + 14
        Dim oChart As Chart
        Dim oWK As Worksheet
        Dim oSeries As Series
        Dim oChartObject As ChartObject
        Set oWK = Excel.Worksheets(1)
        '先创建一个空白的图形壳
        Set oChartObject = oWK.ChartObjects.Add(100, 0, 500, 300)
        Set oChart = oChartObject.Chart
        '对空白的图形进行设置
        With oChart
            '默认创建的是两个系列的散点图
            .ChartWizard Source:=oWK.Range("b" & id & ":cq" & id), gallery:=xlXYScatterLines, PlotBy:=xlColumns, HasLegend:=True, _
            Title:=id, CategoryTitle:="X", ValueTitle:="Y"
            For Each oSeries In .SeriesCollection
                oSeries.Delete
            Next
            Set oSeries = .SeriesCollection.NewSeries
            With oSeries
                .Name = id
                .Values = oWK.Range("b" & id & ":cq" & id)
                .XValues = oWK.Range("b15:cq15")
            End With
        End With
    End Sub
    Sub test()
    Dim a As Integer
    Dim b As String
    a = 1
    b = a + 1
    Debug.Print (b)
    End Sub
    
    Sub char()
        '创建内嵌的图表
        Dim oChart As Chart
        Dim oWK As Worksheet
        Dim oSeries As Series
        Dim oChartObject As ChartObject
        Set oWK = Excel.Worksheets(1)
        '先创建一个空白的图形壳
        Set oChartObject = oWK.ChartObjects.Add(100, 0, 500, 300)
        Set oChart = oChartObject.Chart
        '对空白的图形进行设置
        With oChart
            '默认创建的是两个系列的散点图
            .ChartWizard Source:=oWK.Range("a1:d2"), gallery:=xlXYScatterLines, PlotBy:=xlColumns, HasLegend:=True, _
            Title:="这是一个散点图", CategoryTitle:="X", ValueTitle:="Y"
            For Each oSeries In .SeriesCollection
                oSeries.Delete
            Next
            Set oSeries = .SeriesCollection.NewSeries
            With oSeries
                .Name = "X-Y"
                .Values = oWK.Range("a2:d2")
                .XValues = oWK.Range("a1:d1")
            End With
        End With
    End Sub
    
    

     附上文件链接:链接: https://pan.baidu.com/s/1qKIAHnZdl2S5wyOtUTuHlA 提取码: 9a4y

     

    展开全文
  • Excel VBA创建动态图表

    2019-05-24 01:59:59
    NULL 博文链接:https://jacky2007.iteye.com/blog/369609
  • sheets.Item(1) #%% 获取数据范围 nRow = sheet1.UsedRange.Rows.Count nCol = sheet1.UsedRange.Columns.Count rangeName = cellName(1,1) + ':' + cellName(nRow,nCol) rangeName #%% 创建图表 chart = workbook....

    # -*- coding: utf-8 -*-

    """

    Created on Thu Mar 06 11:22:03 2014

    @author: Administrator

    """

    import win32com.client

    from win32com.gen_py import msof,mspp,msxl

    from string import uppercase

    from pandas import Series

    #%% 将常量发布到全局命名空间中去

    g = globals()

    for c in dir(msof.constants) : g[c] = getattr(msof.constants, c)

    for c in dir(mspp.constants) : g[c] = getattr(mspp.constants, c)

    for c in dir(msxl.constants) : g[c] = getattr(msxl.constants, c)

    #%% 生成行名和坐标的对应关系表

    luc = list(uppercase)

    columns = Series((luc + [i+j for i in luc for j in luc])[:256],range(1,257))

    def cellName(nRow,nCol):

    return columns[nCol]+str(nRow)

    #%% 打开一个测试文件

    application = win32com.client.Dispatch('Excel.Application')

    application.Visible = True

    workbook = application.Workbooks.Open(r'c:\sample1.xls')

    sheets = workbook.Sheets

    sheet1 = sheets.Item(1)

    #%% 获取数据范围

    nRow = sheet1.UsedRange.Rows.Count

    nCol = sheet1.UsedRange.Columns.Count

    rangeName = cellName(1,1) + ':' + cellName(nRow,nCol)

    rangeName

    #%% 创建图表

    chart = workbook.Charts.Add()

    chart.ChartType = xlLine

    chart.SetSourceData(sheet1.Range(rangeName))

    # 遍历所有系列

    seriesCollection = chart.SeriesCollection()

    seriesCollection.Count

    for i in seriesCollection:

    print(i)

    # 参考http://peltiertech.com/Excel/ChartsHowTo/QuickChartVBA.html

    #%% 图表类型说明

    ChartType = {'xlLine':'折线图',

    'xlLineMarkersStacked':'堆积数据点折线图',

    'xlLineStacked':'堆积折线图',

    'xlPie':'饼图',

    'xlPieOfPie':'复合饼图',

    'xlPyramidBarStacked':'堆积条形棱锥图',

    'xlPyramidCol':'三维柱形棱锥图',

    'xlPyramidColClustered':'簇状柱形棱锥图',

    'xlPyramidColStacked':'堆积柱形棱锥图',

    'xlPyramidColStacked100':'百分比堆积柱形棱锥图',

    'xlRadar':'雷达图',

    'xlRadarFilled':'填充雷达图',

    'xlRadarMarkers':'数据点雷达图',

    'xlStockHLC':'盘高-盘低-收盘图',

    'xlStockOHLC':'开盘-盘高-盘低-收盘图',

    'xlStockVHLC':'成交量-盘高-盘低-收盘图',

    'xlStockVOHLC':'成交量-开盘-盘高-盘低-收盘图',

    'xlSurface':'三维曲面图',

    'xlSurfaceTopView':'曲面图(俯视图)',

    'xlSurfaceTopViewWireframe':'曲面图(俯视框架图)',

    'xlSurfaceWireframe':'三维曲面图(框架图)',

    'xlXYScatter':'散点图',

    'xlXYScatterLines':'折线散点图',

    'xlXYScatterLinesNoMarkers':'无数据点折线散点图',

    'xlXYScatterSmooth':'平滑线散点图',

    'xlXYScatterSmoothNoMarkers':'无数据点平滑线散点图',

    'xl3DArea':'三维面积图',

    'xl3DAreaStacked':'三维堆积面积图',

    'xl3DAreaStacked100':'百分比堆积面积图',

    'xl3DBarClustered':'三维簇状条形图',

    'xl3DBarStacked':'三维堆积条形图',

    'xl3DBarStacked100':'三维百分比堆积条形图',

    'xl3DColumn':'三维柱形图',

    'xl3DColumnClustered':'三维簇状柱形图',

    'xl3DColumnStacked':'三维堆积柱形图',

    'xl3DColumnStacked100':'三维百分比堆积柱形图',

    'xl3DLine':'三维折线图',

    'xl3DPie':'三维饼图',

    'xl3DPieExploded':'分离型三维饼图',

    'xlArea':'面积图',

    'xlAreaStacked':'堆积面积图',

    'xlAreaStacked100':'百分比堆积面积图',

    'xlBarClustered':'簇状条形图',

    'xlBarOfPie':'复合条饼图',

    'xlBarStacked':'堆积条形图',

    'xlBarStacked100':'百分比堆积条形图',

    'xlBubble':'气泡图',

    'xlBubble3DEffect':'三维气泡图',

    'xlColumnClustered':'簇状柱形图',

    'xlColumnStacked':'堆积柱形图',

    'xlColumnStacked100':'百分比堆积柱形图',

    'xlConeBarClustered':'簇状条形圆锥图',

    'xlConeBarStacked':'堆积条形圆锥图',

    'xlConeBarStacked100':'百分比堆积条形圆锥图',

    'xlConeCol':'三维柱形圆锥图',

    'xlConeColClustered':'簇状柱形圆锥图',

    'xlConeColStacked':'堆积柱形圆锥图',

    'xlConeColStacked100':'百分比堆积柱形圆锥图',

    'xlCylinderBarClustered':'簇状条形圆柱图',

    'xlCylinderBarStacked':'堆积条形圆柱图',

    'xlCylinderBarStacked100':'百分比堆积条形圆柱图',

    'xlCylinderCol':'三维柱形圆柱图',

    'xlCylinderColClustered':'簇状柱形圆锥图',

    'xlCylinderColStacked':'堆积柱形圆锥图',

    'xlCylinderColStacked100':'百分比堆积柱形圆柱图',

    'xlDoughnut':'圆环图',

    'xlDoughnutExploded':'分离型圆环图',

    'xlLineMarkers':'数据点折线图',

    'xlLineMarkersStacked100':'百分比堆积数据点折线图',

    'xlLineStacked100':'百分比堆积折线图',

    'xlPieExploded':'分离型饼图',

    'xlPyramidBarClustered':'簇状条形棱锥图',

    'xlPyramidBarStacked100':'百分比堆积条形棱锥图'}

    展开全文
  • 寻找有关更新完成以下(基本算法)的VBA脚本的一些帮助:包含公式和宏的Excel模板创建一个包含大约30个图表的自定义报告名为“CreatePowerPointPresentation”的宏用于将这些图表以特定格式传输到特定的PowerPoint模板...

    寻找有关更新完成以下(基本算法)的VBA脚本的一些帮助:

    包含公式和宏的Excel模板创建一个包含大约30个图表的自定义报告

    名为“CreatePowerPointPresentation”的宏用于将这些图表以特定格式传输到特定的PowerPoint模板

    宏使用模板中包含的幻灯片创建前6张幻灯片

    然后宏添加幻灯片(转场和内容幻灯片)

    Note :此宏实际上是根据此论坛的反馈创建的

    此宏在带有Office 2013的Windows 7中运行良好,但在创建幻灯片8之后,在其中一个粘贴图表操作期间随机生成了Windows 10,Office 2016中的错误,但从未超过17张幻灯片的幻灯片10 .

    Errors:

    Runtime Error '-2147188160 (80048240)

    Method 'PasteSpecial'of object 'Shapes' failed.

    要么

    Runtime Error '-2147023170 (800706be)':

    Automation Error

    The Remote procedure call failed.

    我不确定这是一个对象问题还是我遗失的其他一些内容 .

    Code below:

    Sub CreatePowerPointPresentation()

    '=========================================================================

    'Create PowerPoint Presentation

    'Assigned to Index Tab

    '==========================================================================

    Dim newPowerPoint As PowerPoint.Application

    Dim activeSlide As PowerPoint.Slide

    Dim CHT As Excel.ChartObject

    Dim fmt As String

    Dim hgt As String

    Dim wth As String

    ‘this code allows for the user to select whether to paste the charts as Excel Charts or PNG Formatted images.

    Sheets("Index").Select

    If Range("AB7").Value = "Excel Charts" Then

    fmt = ppPasteDefault

    Else

    fmt = ppPastePNG

    End If

    'Establishes the global height and width of the graphics or charts pasted from Excel

    hgt = 280

    wth = 710

    'Look for existing instance

    On Error Resume Next

    Set newPowerPoint = GetObject(, "PowerPoint.Application")

    On Error GoTo 0

    'Create a new PowerPoint

    If newPowerPoint Is Nothing Then

    Set newPowerPoint = New PowerPoint.Application

    End If

    'Make a presentation in PowerPoint

    If newPowerPoint.Presentations.Count = 0 Then

    newPowerPoint.Presentations.Add

    End If

    'Show the PowerPoint

    newPowerPoint.Visible = True

    Application.EnableEvents = True

    Application.ScreenUpdating = True

    'Apply Template & Create Title Slide 1

    newPowerPoint.ActivePresentation.ApplyTemplate Application.DefaultFilePath & "\file.potx"

    'Set presentation to be 16x9

    'AppActivate ("Microsoft PowerPoint")

    With newPowerPoint.ActivePresentation.PageSetup

    .SlideSize = ppSlideSizeOnScreen16x9

    .FirstSlideNumber = 1

    .SlideOrientation = msoOrientationHorizontal

    .NotesOrientation = msoOrientationVertical

    End With

    'Create Slides 2-6 these are imported from the template

    newPowerPoint.ActivePresentation.Slides.InsertFromFile Application.DefaultFilePath & "\File.potx", 0, 1

    'Create Slide 7

    newPowerPoint.ActivePresentation.Slides.Add newPowerPoint.ActivePresentation.Slides.Count + 1, ppLayoutBlank

    newPowerPoint.ActivePresentation.Slides(7).CustomLayout = newPowerPoint.ActivePresentation.SlideMaster.CustomLayouts(33)

    Set activeSlide = newPowerPoint.ActivePresentation.Slides(newPowerPoint.ActivePresentation.Slides.Count)

    With newPowerPoint.ActivePresentation.Slides(7)

    .Shapes("Title 1").TextFrame.TextRange.Text = "Title1"

    End With

    newPowerPoint.ActiveWindow.ViewType = ppViewSlide

    ‘Create Slide 8 – Quad Chart Slide

    newPowerPoint.ActivePresentation.Slides.Add newPowerPoint.ActivePresentation.Slides.Count + 1, ppLayoutBlank

    newPowerPoint.ActivePresentation.Slides(8).CustomLayout = newPowerPoint.ActivePresentation.SlideMaster.CustomLayouts(13)

    newPowerPoint.ActiveWindow.View.GotoSlide newPowerPoint.ActivePresentation.Slides.Count

    newPowerPoint.ActivePresentation.Slides(8).Shapes("Title 1").TextFrame.TextRange.Text = "Title 1"

    Set activeSlide = newPowerPoint.ActivePresentation.Slides(newPowerPoint.ActivePresentation.Slides.Count)

    newPowerPoint.ActiveWindow.ViewType = ppViewSlide

    'Upper Left

    Sheets("Charts").Select

    ActiveSheet.ChartObjects("Chart 3").Select

    ActiveChart.ChartArea.Copy

    newPowerPoint.ActiveWindow.ViewType = ppViewSlide

    activeSlide.Shapes.PasteSpecial(DataType:=fmt).Select

    'Adjust the positioning of the Chart on Powerpoint Slide

    newPowerPoint.ActiveWindow.Selection.ShapeRange.Left = 5

    newPowerPoint.ActiveWindow.Selection.ShapeRange.Top = 75

    newPowerPoint.ActiveWindow.Selection.ShapeRange.LockAspectRatio = msoFalse

    newPowerPoint.ActiveWindow.Selection.ShapeRange.Height = 145

    newPowerPoint.ActiveWindow.Selection.ShapeRange.Width = 345

    'Upper Right

    Sheets("Charts").Select

    ActiveSheet.ChartObjects("Chart 2").Select

    ActiveChart.ChartArea.Copy

    newPowerPoint.ActiveWindow.ViewType = ppViewSlide

    activeSlide.Shapes.PasteSpecial(DataType:=fmt).Select

    newPowerPoint.ActiveWindow.Selection.ShapeRange.Left = 350

    newPowerPoint.ActiveWindow.Selection.ShapeRange.Top = 75

    newPowerPoint.ActiveWindow.Selection.ShapeRange.LockAspectRatio = msoFalse

    newPowerPoint.ActiveWindow.Selection.ShapeRange.Height = 145

    newPowerPoint.ActiveWindow.Selection.ShapeRange.Width = 345

    'Lower Left

    Sheets("Charts").Select

    ActiveSheet.ChartObjects("Chart 4").Select

    ActiveChart.ChartArea.Copy

    newPowerPoint.ActiveWindow.ViewType = ppViewSlide

    activeSlide.Shapes.PasteSpecial(DataType:=fmt).Select

    newPowerPoint.ActiveWindow.Selection.ShapeRange.Left = 5

    newPowerPoint.ActiveWindow.Selection.ShapeRange.Top = 230

    newPowerPoint.ActiveWindow.Selection.ShapeRange.LockAspectRatio = msoFalse

    newPowerPoint.ActiveWindow.Selection.ShapeRange.Height = 145

    newPowerPoint.ActiveWindow.Selection.ShapeRange.Width = 690

    ‘More slides……

    Application.EnableEvents = True

    Application.ScreenUpdating = True

    Set activeSlide = Nothing

    Set newPowerPoint = Nothing

    End Sub

    展开全文
  • conn For i = 0 To rs.Fields.Count - 1 sht.Cells(1, i + 1) = rs(i).Name Next sht.Range("a2").CopyFromRecordset rs conn.Close Set rs = Nothing Set conn = Nothing 'Set sht = Nothing End Sub '创建图表 ...
    Option Explicit
    
    '输出
    Sub export()
        Dim sht As Worksheet, sql As String, sht1 As Worksheet, i, shtname, rng
        
        Set sht = ThisWorkbook.Worksheets("HZ")
        sql = "SELECT DISTINCT YF,SP,'' TB FROM CG order by yf,sp"
        exportdata sht, sql
        
        For i = 2 To sht.UsedRange.Rows.Count
            shtname = sht.Cells(i, 1) & "_" & sht.Cells(i, 2)
            Set sht1 = ThisWorkbook.Worksheets.Add(after:=ThisWorkbook.Worksheets(ThisWorkbook.Worksheets.Count))
            sht1.Name = shtname
            sql = "exec getdata '" & sht.Cells(i, 1) & "','" & sht.Cells(i, 2) & "'"
            exportdata sht1, sql
            Set sht1 = Nothing
            
        Next
        
        
        For i = 2 To sht.UsedRange.Rows.Count
            shtname = sht.Cells(i, 1) & "_" & sht.Cells(i, 2)
            
            sht.Activate
            Set rng = sht.Cells(i, 3)
            rng.Hyperlinks.Add anchor:=rng, Address:="", SubAddress:="HZ!A1", TextToDisplay:="图表"
            Set rng = Nothing
            
            CreateChart (shtname)
            ThisWorkbook.Worksheets(shtname).Visible = False
        Next
        
        sht.Activate
        Set sht = Nothing
    
    End Sub
    
    ' openrecordset 输出工作表
    Sub exportdata(sht As Worksheet, sql As String)
        Dim conn, rs, i
        sht.Cells.Clear
        
        Set conn = CreateObject("ADODB.Connection")
        Set rs = CreateObject("Adodb.Recordset")
        conn.Open "Provider=sqloledb;server=127.0.0.1,1433\sqlexpress;database=amain;Integrated Security=SSPI;Persist Security Info =False;"
        rs.Open sql, conn
        
        For i = 0 To rs.Fields.Count - 1
            sht.Cells(1, i + 1) = rs(i).Name
        Next
        
        sht.Range("a2").CopyFromRecordset rs
        
        conn.Close
        
        Set rs = Nothing
        Set conn = Nothing
        'Set sht = Nothing
    End Sub
    
    '创建图表
    Sub CreateChart(shtname)
        
        Dim sht As Worksheet, max, min
        Set sht = ThisWorkbook.Worksheets(shtname)
        sht.Activate
        
        max = Excel.Application.WorksheetFunction.max(sht.Range("B2:E" & sht.UsedRange.Rows.Count))
        min = Excel.Application.WorksheetFunction.min(sht.Range("B2:E" & sht.UsedRange.Rows.Count))
        
        sht.Shapes.AddChart2(332, xlLineMarkers).Select
        With ActiveChart
            .SetSourceData Source:=sht.UsedRange
            .ChartStyle = 236
            .ChartTitle.Text = Mid(shtname, 1, 4) & "年" & CInt(Mid(shtname, 5, 2)) & "月 " & Split(shtname, "_")(1)
            .Axes(xlValue).MinimumScale = Round(min - (max - min) * 0.4, 2)
            .Axes(xlValue).MaximumScale = Round(max + (max - min) * 0.1, 2)
        End With
        
        With ActiveChart.ChartTitle.Format.TextFrame2.TextRange.Font
        .NameComplexScript = "微软雅黑"
        .NameFarEast = "微软雅黑"
        .Name = "微软雅黑"
        .Size = 22
        End With
     
        sht.ChartObjects(1).Activate
        ActiveChart.Location Where:=xlLocationAsNewSheet
        ActiveSheet.Name = "c_" & shtname
        
        AddButton "c_" & shtname
        
        Set sht = Nothing
    End Sub
    
    '添加返回按钮
    Private Sub AddButton(chartname)
        
        Dim char As Chart
        Set char = ThisWorkbook.Sheets(chartname)
        
        Dim sha As Shape
        Set sha = char.Shapes.AddFormControl(Type:=xlButtonControl, Left:=20, Top:=20, Width:=50, Height:=20)
            
        With sha
            With .TextFrame.Characters
                .Text = "返回"
            End With
            .OnAction = "FanHui"
        End With
            
        Set sha = Nothing
        Set char = Nothing
    End Sub
    
    '清除sheet
    Private Sub deleAllSheets()
        Dim sht
        Excel.Application.DisplayAlerts = False
        For Each sht In ThisWorkbook.Sheets
            If sht.Name <> "HZ" Then sht.Delete
        Next
        ThisWorkbook.Worksheets("HZ").Cells.Clear
        Excel.Application.DisplayAlerts = True
    End Sub
    
    '返回事件
    Sub FanHui()
        ThisWorkbook.Worksheets("HZ").Activate
    End Sub
    
    Option Explicit
    
    Private Sub Worksheet_FollowHyperlink(ByVal Target As Hyperlink)
        Dim rng As Range, shtname
        Set rng = Target.Range
    
        shtname = "c_" & rng.Offset(0, -2).Value & "_" & rng.Offset(0, -1).Value
        ThisWorkbook.Sheets(shtname).Activate
        Set rng = Nothing
    End Sub
    

     

    展开全文
  • #%% 创建图表 chart = workbook.Charts.Add() chart.ChartType = xlLine chart.SetSourceData(sheet1.Range(rangeName)) # 遍历所有系列 seriesCollection = chart.SeriesCollection() seriesCollection...
  • 使用VBA,可以根据特定标准生成图表。下面通过一个例子来看看它如何实现。 第1步 - 输入要生成图形的数据。 第2步 - 创建3个按钮 - 一个生成条形图,另一个生成饼图,另一个生成柱形图。 第3步 - 开发一个...
  • Excel VBA:创建与删除图表

    千次阅读 2020-01-13 14:52:59
    由指定的图表工作表、对话框工作表或工作表上的所有 ChartObject 对象组成的集合。 说明 ChartObjects 集合 使用 ChartObjects(index)(其中index 是嵌入图表的索引号或名称)可以返回单个对象。以下示例设置名为...
  • sheets.Item(1) #%% 获取数据范围 nRow = sheet1.UsedRange.Rows.Count nCol = sheet1.UsedRange.Columns.Count rangeName = cellName(1,1) + ':' + cellName(nRow,nCol) rangeName #%% 创建图表 chart = workbook....
  • Excel的制图功能是非常强大的,你可以创建各种各样的数据图表,你也可以修改你制作完成的每一个图表的细节,对他进行修改和完善。相信你肯定已经熟悉在excel中间如何生成图表,如何优化图表的能力了。但是你在普通的...
  • ①昨天主要是讲了VBA创建在sheet上面的图表,如果单独在Chart上创建图表的话,用Charts的add2方法就可以了: Charts.Add2 ②创建完了如果需要引用数据的话,可以和昨天一样引用数据: Sub demo() Dim myChart...
  • DOT 和 SumTrans 系列来创建图表 2.-使用数据透视表甚至更好,您可以克隆您的Recordset以创建一个数据透视表,允许您通过DOT进行SUM数量 *Wkb is a Workbooks object, Wks is a Worksheet object* Dim oRstChrt As ...
  • 学习Excel技术,关注微信公众号:excelperfect图表是数据可视化的一种常用呈现方式,VBA代码可以帮助我们自动化创建图表及对图表进行相关的操作,特别是当工作表中有大量图表需要进行重复修改时,VBA十分有用。...
  • 本文以《Excel VBA——创建组合图表》中生成的图表为例讲述如何通过VBA中Series对象的Formula属性提取图表中数据系列的引用区域。如图1,图表中的“目标值”,“设计方案”,“偏差”就是构成图表的三个数据系列,每...
  • VBA基础学习之编程图表 使用VBA,可以根据特定标准生成图表。下面通过一个例子来看看它如何实现。 第1步 - 输入要生成图形的数据。 第2步 - 创建3个按钮 - 一个生成条形图,另一个生成饼图,另一个生成柱形图。 ...
  • 本文以《Excel VBA——创建组合图表》中生成的图表为例讲述如何通过VBA中Series对象的Formula属性提取图表中数据系列的引用区域。如图1,图表中的“目标值”,“设计方案”,“偏差”就是构成图表的三个数据系列,每...
  • 使用数据透视图汇总数百万行数据,在不使用图表的情况下以图形方式显示数据,使用SmartArt图形绘制流程图和关系图,使用VBA创建图表,将数据绘制到地图中,将图表导出到网页或PowerPoint中,找出图表背后的谎言等。
  • 使用数据透视图汇总数百万行数据,在不使用图表的情况下以图形方式显示数据,使用SmartArt图形绘制流程图和关系图,使用VBA创建图表,将数据绘制到地图中,将图表导出到网页或PowerPoint中,找出图表背后的谎言等。...
  • 使用数据透视图汇总数百万行数据,在不使用图表的情况下以图形方式显示数据,使用SmartArt图形绘制流程图和关系图,使用VBA创建图表,将数据绘制到地图中,将图表导出到网页或PowerPoint中,找出图表背后的谎言等。...
  • 使用数据透视图汇总数百万行数据,在不使用图表的情况下以图形方式显示数据,使用SmartArt图形绘制流程图和关系图,使用VBA创建图表,将数据绘制到地图中,将图表导出到网页或PowerPoint中,找出图表背后的谎言等。...
  • 使用数据透视图汇总数百万行数据,在不使用图表的情况下以图形方式显示数据,使用SmartArt图形绘制流程图和关系图,使用VBA创建图表,将数据绘制到地图中,将图表导出到网页或PowerPoint中,找出图表背后的谎言等。...
  • 使用数据透视图汇总数百万行数据,在不使用图表的情况下以图形方式显示数据,使用SmartArt图形绘制流程图和关系图,使用VBA创建图表,将数据绘制到地图中,将图表导出到网页或PowerPoint中,找出图表背后的谎言等。...
  • 使用数据透视图汇总数百万行数据,在不使用图表的情况下以图形方式显示数据,使用SmartArt图形绘制流程图和关系图,使用VBA创建图表,将数据绘制到地图中,将图表导出到网页或PowerPoint中,找出图表背后的谎言等。...
  • 使用数据透视图汇总数百万行数据,在不使用图表的情况下以图形方式显示数据,使用SmartArt图形绘制流程图和关系图,使用VBA创建图表,将数据绘制到地图中,将图表导出到网页或PowerPoint中,找出图表背后的谎言等。...
  • 使用数据透视图汇总数百万行数据,在不使用图表的情况下以图形方式显示数据,使用SmartArt图形绘制流程图和关系图,使用VBA创建图表,将数据绘制到地图中,将图表导出到网页或PowerPoint中,找出图表背后的谎言等。...

空空如也

空空如也

1 2 3 4 5 ... 10
收藏数 197
精华内容 78
关键字:

vba创建图表