用EXCEL来打印报表并生成折线图

 时间:2024-10-20 11:36:37

rivateSubPrintFunc()onerrorgotoPrintFunc_ErrDimCtAsObjectSetex=CreateObject("Excel.Application")'增加工作表ex.Workbooks.Add'输出数据ex.Range("A1").Value="系列1"

用EXCEL来打印报表并生成折线图

方法/步骤

1、ex.Ran壹执慵驾ge("A2").Value=8ex.Range("A3"稆糨孝汶;).Value=16ex.Range("A4").Value=7ex.Range("A5").Value=22ex.Range("A6").Value=13ex.Range("A7").Value=15ex.Range("A8").Value=11ex.Range("B1").Value="系列2"

用EXCEL来打印报表并生成折线图

2、x.Range("B2").V瞢铍库祢alue=5ex.Range("B3媪青怍牙").Value=6ex.Range("B4").Value=17ex.Range("B5").Value=10ex.Range("B6").Value=3ex.Range("B7").Value=9ex.Range("B8").Value=16'设定表格样式ex.Range("A1","B8").Borders.LineStyle=xlContinuous

用EXCEL来打印报表并生成折线图

3、ex.Cells(,1).ColumnWidth=25ex.Cells(,2).ColumnWidth=25’插入折线图

用EXCEL来打印报表并生成折线图

4、SetCt=ex.Worksheets("sheet1").ChartObjects.Add(0,130,350,250)Ct.Chart.ChartWizardSource:=ex.Worksheets("sheet1").Range("A2:B8"),_gallery:=xlLine,Title:="NewChart"ex.Visible=True

用EXCEL来打印报表并生成折线图

5、'打印预揽ex.ActiveWindow.SelectedSheets.PrintPreview'关闭EXCEL

用EXCEL来打印报表并生成折线图

6、ex.Visible=Falseex.Worksheets("sheet1").ChartObjects.Deleteex.ActiveWorkbook.Closesavechanges:=False

用EXCEL来打印报表并生成折线图

7、PrintFunc_Err:Setex=NothingSetCt=NothingendSub

用EXCEL来打印报表并生成折线图

Excel同一个图里面画出横纵坐标都不同的曲线 EXCEL中如何为图表的坐标轴设置箭头格式 Excel图表修改横坐标的方法 excel折线图横坐标数字改成自己设定的 excel怎么自定义x轴和y轴
热门搜索
名酒图片 大张伟图片 好人卡图片 北京小吃图片 蔷薇少女图片