|
5学分
【求助】:各位vba高手们,我想在工作表中插入我想要的图表。因为我要做的图表太多,工作量很大,所以我急需一个能在工作表中插入图表的VBA。现在我录制了一段VBA代码,但是里面的代码是什么意思,我完全不知道,请各位高手们能帮我讲解一下代码的含义了。十分感激你们的帮助了!!!!- Sub Macro4()
- Charts.Add
- ActiveChart.ChartType = xlLineMarkers
- ActiveChart.SetSourceData Source:=Sheets("Sheet1").Range("C42")
- ActiveChart.SeriesCollection.NewSeries
- ActiveChart.SeriesCollection(1).XValues = "=Sheet1!R3C1:R17C1"
- ActiveChart.SeriesCollection(1).Values = "=Sheet1!R3C8:R17C8"
- ActiveChart.SeriesCollection(1).Name = "=""百米钻孔流量"""
- ActiveChart.Location Where:=xlLocationAsObject, Name:="Sheet1"
- With ActiveChart
- .HasTitle = True
- .ChartTitle.Characters.Text = "下抽巷百米钻孔流量"
- .Axes(xlCategory, xlPrimary).HasTitle = True
- .Axes(xlCategory, xlPrimary).AxisTitle.Characters.Text = "时间"
- .Axes(xlValue, xlPrimary).HasTitle = True
- .Axes(xlValue, xlPrimary).AxisTitle.Characters.Text = "百米钻孔流量值"
- End With
- Windows("123456.xls").SmallScroll Down:=3
- ActiveSheet.Shapes("图表 3").IncrementLeft -204.75
- ActiveSheet.Shapes("图表 3").IncrementTop 273#
- Windows("123456.xls").SmallScroll Down:=12
- ActiveSheet.Shapes("图表 3").ScaleWidth 1.33, msoFalse, msoScaleFromTopLeft
- ActiveSheet.Shapes("图表 3").ScaleHeight 1.07, msoFalse, msoScaleFromTopLeft
- ActiveWindow.Visible = False
- Windows("123456.xls").Activate
- Range("F43").Select
- Application.CommandBars("Stop Recording").Visible = False
- End Sub
复制代码 |
|