用VB读取了一个excel表,怎么根据表中一列的数据制作折线图?
读取程序是PrivateSubCommand1_Click()CommonDialog1.CancelError=True'设置标志CommonDialog1.Flags...
读取程序是
Private Sub Command1_Click()
CommonDialog1.CancelError = True'设置标志
CommonDialog1.Flags = cdlOFNHideReadOnly '设置过滤器 CommonDialog1.Filter = "全部文件|*.*|表格文件|*.xls|" '设置缺省的过滤器 CommonDialog1.FilterIndex = 2 CommonDialog1.ShowOpenDim ExcelApp As Excel.Application
Set ExcelApp = CreateObject("excel.application")
ExcelApp.Workbooks.Open (CommonDialog1.FileName)
With MSFlexGrid1
.Rows = ExcelApp.Sheets(1).UsedRange.Rows.Count .Cols = 100 For r = 0 To .Rows - 1 For c = 2 To .Cols If c = 2 Then .TextMatrix(r, c - 2) = ExcelApp.Sheets(1).Cells(r + 1, c - 1) Else .TextMatrix(r, c - 2) = ExcelApp.Sheets(1).Cells(r + 1, c - 1) End If Next NextEnd With
ExcelApp.Quit
End Sub
求指点怎么利用一列的数据画折线图 展开
Private Sub Command1_Click()
CommonDialog1.CancelError = True'设置标志
CommonDialog1.Flags = cdlOFNHideReadOnly '设置过滤器 CommonDialog1.Filter = "全部文件|*.*|表格文件|*.xls|" '设置缺省的过滤器 CommonDialog1.FilterIndex = 2 CommonDialog1.ShowOpenDim ExcelApp As Excel.Application
Set ExcelApp = CreateObject("excel.application")
ExcelApp.Workbooks.Open (CommonDialog1.FileName)
With MSFlexGrid1
.Rows = ExcelApp.Sheets(1).UsedRange.Rows.Count .Cols = 100 For r = 0 To .Rows - 1 For c = 2 To .Cols If c = 2 Then .TextMatrix(r, c - 2) = ExcelApp.Sheets(1).Cells(r + 1, c - 1) Else .TextMatrix(r, c - 2) = ExcelApp.Sheets(1).Cells(r + 1, c - 1) End If Next NextEnd With
ExcelApp.Quit
End Sub
求指点怎么利用一列的数据画折线图 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询
广告 您可能关注的内容 |