ActiveWorkbook.Worksheets("Sheet1").Range("a1:g6").Name = "data0"
With ActiveWorkbook.Worksheets("Sheet1").Range("data0").Font
.Name = "楷体"
.Size = 14
.Color = RGB(255, 0, 0)
.Bold = True
.Italic = True
.Underline = xlUnderlineStyleDouble
End With
ActiveWorkbook.Worksheets("Sheet1").Range("data0").Interior.Color = RGB(0, 100, 200)
'Range("data0").Select
With ActiveWorkbook.Worksheets("Sheet1").Range("c9:g12").Borders
.LineStyle = xlDouble
.Color = RGB(255, 100, 255)
.Weight = xlHairline
End With
Worksheets("Sheet1").Range("A1:G1").Borders(xlEdgeBottom).Color = RGB(255, 0, 0)
MsgBox "The name of the active workbook is " & ActiveWorkbook.Name
End Sub
Sub zhu_xing_tu()
'创建独立的图表
Dim oChart As Chart
Dim oWK As Worksheet
Set oWK = Excel.Worksheets(1)
Dim oChartObject As ChartObject
'先创建一个空白的图形
Set oChart = Excel.charts.Add
'对空白的图形进行设置
With oChart
.ChartWizard Source:=oWK.Range("a1:b13"), gallery:=xlColumnClustered, PlotBy:=xlColumns, HasLegend:=False, _
Title:="这是一个柱形图", CategoryTitle:="日期", ValueTitle:="体温"
'将无数据的点用线连接
.DisplayBlanksAs = xlInterpolated
.ChartType = xlLine
'显示数据表
.HasDataTable = True
End With
End Sub
Sub del()
If ActiveSheet.ChartObjects.Count >= 1 Then
ActiveSheet.ChartObjects.Delete
End If
End Sub