ExcelTip.Net留存知识帖 ---【注:附件之前被网盘供应商清空后,现已修复-现已修复-现已修复为本地下载!】
现在位置:首页 > 我的酷贴 > VSTO > 如何在VSTO实现单元格格式自动填充?

如何在VSTO实现单元格格式自动填充?

作者:绿色风 分类: 时间:2022-08-18 浏览:114
楼主
wise
Q:如何在VSTO实现单元格格式自动填充?
A:其VSTO代码如下:

  1. Public Class Sheet1
  2.     Private Sub Sheet1_Startup() Handles Me.Startup
  3.         Dim rng As Excel.Range = Globals.Sheet1.Range("A1:F10")
  4.         '定义rng为Sheet1工作表的A1:F10单元格区域
  5.         rng.AutoFormat(Excel.XlRangeAutoFormat.xlRangeAutoFormat3DEffects2, True, False, True, False, True, True)
  6.         '第1个表示填充的格式为 xlRangeAutoFormat3DEffects2
  7.     End Sub
  8. End Class

关键是:rng.AutoFormat的使用
2楼
wise
Member name

Description
xlRangeAutoFormat3DEffects13-D effects 1.
xlRangeAutoFormat3DEffects23-D effects 2.
xlRangeAutoFormatAccounting1Accounting 1.
xlRangeAutoFormatAccounting2Accounting 2.
xlRangeAutoFormatAccounting3Accounting 3.
xlRangeAutoFormatAccounting4Accounting 4.
xlRangeAutoFormatClassic1Classic 1.
xlRangeAutoFormatClassic2Classic 2.
xlRangeAutoFormatClassic3Classic 3.
xlRangeAutoFormatClassicPivotTableClassic pivot table.
xlRangeAutoFormatColor1Color 1.
xlRangeAutoFormatColor2Color 2.
xlRangeAutoFormatColor3Color 3.
xlRangeAutoFormatList1List 1.
xlRangeAutoFormatList2List 2.
xlRangeAutoFormatList3List 3.
xlRangeAutoFormatLocalFormat1Local Format 1.
xlRangeAutoFormatLocalFormat2Local Format 2.
xlRangeAutoFormatLocalFormat3Local Format 3.
xlRangeAutoFormatLocalFormat4Local Format 4.
xlRangeAutoFormatNoneNo specified format.
xlRangeAutoFormatPTNoneNo specified pivot table format.
xlRangeAutoFormatReport1Report 1.
xlRangeAutoFormatReport10Report 10.
xlRangeAutoFormatReport2Report 2.
xlRangeAutoFormatReport3Report 3.
xlRangeAutoFormatReport4Report 4.
xlRangeAutoFormatReport5Report 5.
xlRangeAutoFormatReport6Report 6.
xlRangeAutoFormatReport7Report 7.
xlRangeAutoFormatReport8Report 8.
xlRangeAutoFormatReport9Report 9.
xlRangeAutoFormat****.
xlRangeAutoFormatTable1Table 1.
xlRangeAutoFormatTable10Table 10.
xlRangeAutoFormatTable2Table 2.
xlRangeAutoFormatTable3Table 3.
xlRangeAutoFormatTable4Table 4.
xlRangeAutoFormatTable5Table 5.
xlRangeAutoFormatTable6Table 6.
xlRangeAutoFormatTable7Table 7.
xlRangeAutoFormatTable8Table 8.
xlRangeAutoFormatTable9Table 9.

免责声明

有感于原ExcelTip.Net留存知识的价值及部分知识具有的时间限定性因素, 经与ExcelTip.Net站长Apolloh商议并征得其同意, 现将原属ExcelTip.Net的知识帖采集资料于本站点进行展示, 供有需要的人士查询使用,也慰缅曾经的论坛时代。 所示各个帖子的原作者如对版权有异议, 可与本人沟通提出,或于本站点留言,我们会尽快处理。 在此,感谢ExcelTip.Net站长Apolloh的支持,感谢本站点所有人**绿色风(QQ:79664738)**的支持与奉献,特此鸣谢!
------本人网名**KevinChengCW(QQ:1210618015)**原ExcelTip.Net总版主之一

评论列表
sitemap