麻烦大家看看下面的代码对吗?能否用MSChart显示MSHFlexGrid中指定的行(上下)和列(左右),谢谢谢谢

ozarkgirl 2001-11-26 04:32:25
Private Sub Command2_Click()
Dim a As Integer
a = 2
If MSHFlexGrid1.TextMatrix(MSHFlexGrid1.Row, 2) <> "" And IsNull(MSHFlexGrid1.TextMatrix(MSHFlexGrid1.Row, 2)) = False Then '该表格有数据
With MSChart1
.chartType = VtChChartType2dBar
.ColumnCount = 3
.RowCount = MSHFlexGrid1.Rows - 1
.RowCount = 1
.TitleText = "直方图示例 本旬出口数量与去年同期对比值"
Dim XXX, XXXX, XXXXX As Double
' For I = 1 To MSHFlexGrid1.Rows - 1
XXX = Val(MSHFlexGrid1.TextMatrix(MSHFlexGrid1.col, a .Row, 2))
XXXX = Val(MSHFlexGrid1.TextMatrix(MSHFlexGrid1.col, a .Row, 3))
XXXXX = Val(MSHFlexGrid1.TextMatrix(MSHFlexGrid1.col, a .Row, 4))
.Column = 1
.Row = 1
.Data = XXX
.Column = 2
.Row = 1
.Data = XXXX
.Column = 3
.Row = 1
.Data = XXXXX
.RowLabel = "第一月"
' Next I
.Column = 1
.ColumnLabel = "成本"
.Column = 2
.ColumnLabel = "产量"
.Column = 3
.ColumnLabel = "利润"
If a < MSHFlexGrid1.Col - 1 Then
a = a + 1
End If
End With
End If
End Sub
...全文
62 3 打赏 收藏 转发到动态 举报
写回复
用AI写文章
3 条回复
切换为时间正序
请发表友善的回复…
发表回复
ozarkgirl 2001-11-27
  • 打赏
  • 举报
回复
帮帮忙啊`~~~是很难嘛?
ozarkgirl 2001-11-27
  • 打赏
  • 举报
回复
大家帮忙看看啊
ozarkgirl 2001-11-26
  • 打赏
  • 举报
回复
快来看啊~~~~~来不及了~~~谢谢谢谢了

7,755

社区成员

发帖
与我相关
我的任务
社区描述
VB 基础类
社区管理员
  • VB基础类社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧