1.vb6 å¦ä½å¶ä½è¿å¤§è¿å°çå¾ç
2.excel 使用VB创建数据透视表(pivottable)问题
vb6 å¦ä½å¶ä½è¿å¤§è¿å°çå¾ç
è¿å°±æ¯æè°çâéè§âé®é¢å§ï¼ç®åçâè¿å°è¿å¤§âï¼ä¸å¼ å¾çå¨FORMä¸é´ï¼å¾ççä¸å¿ç¹æ¯å®ç¹çï¼æ²¡æ移å¨ï¼ï¼å®ï¼heightåwidthçå¼éå ï¼ç±å°å大ï¼å¦æå¾çè¿è½å¤å ä¸ä»¿çéè§å°±çå®å¤äºå°±åæ们çå®çæ¯ç©ç±è¿å°è¿ï¼ä¼æè§è§å移ï¼æ³è±¡ï¼ã
excel 使用VB创建数据透视表(pivottable)问题
粘贴一段以前写的透视代码
供参考
Dim DataRng As Range '定义一个数据范围,用来储存生成数据透视表的源码文章釆集源码数据
Dim MyPivot As Worksheet '定义一个工作表,存放数据透视表"
Dim pt As PivotTable '定义一个数据透视表,透视可乐电影网源码用来储存数据透视表对象”
Dim MyTable As Worksheet '定义一个工作表,源码魔趣源码国内镜像做为汇总表
Dim ptcache As PivotCache
Set DataRng = Range("A1:D" & zuidazhi)
'
Set ptcache = ActiveWorkbook.PivotCaches.Add(SourceType:=xlDatabase,透视起名小程序源码下载 SourceData:=DataRng)
Sheets.Add
Sheets("Sheet1").Select
Set pt = ptcache.CreatePivotTable(tabledestination:=Sheets("Sheet1").Range("b1"), TableName:="pivottable1")
With ActiveSheet.PivotTables("pivottable1").PivotFields("采样时间")
.Orientation = xlRowField
.Position = 1
End With
With ActiveSheet.PivotTables("pivottable1").PivotFields("样品名称")
.Orientation = xlRowField
.Position = 2
End With
With ActiveSheet.PivotTables("pivottable1").PivotFields("分项")
.Orientation = xlRowField
.Position = 3
End With
ActiveSheet.PivotTables("pivottable1").AddDataField ActiveSheet.PivotTables("pivottable1" _
).PivotFields("值"), "计数项:值", xlCount
With ActiveSheet.PivotTables("pivottable1").PivotFields("计数项:值")
.Caption = "平均值项:值"
.Function = xlAverage
End With