学习VBA,正好给财务制作一个小工具: Sub 打开人员信息表() Dim wb As Workbook, c As Integer Set wb = Workbooks.Open(, True) c = wb.Worksheets.Count If c < Then wb.Worksheets.Add after:=Worksheets(Worksheets.Count) wb.Worksheets().Select End Sub Sub 添加选中人员() Dim fw As Workshe
不知道为什么计组老师的大量课件字体是伤害视力的亮蓝色……看久了眼睛疼,想把颜色替换成保护视力一点的灰色,但是找了N久也没找到在图形界面上直接操作的方法,于是在MSDN上晃了晃,Google了一下,写了个VBA小脚本,只替换选定颜色,这样可以保留红色或者其他颜色的高亮,顺便把让人分心的花花背景也干掉. Sub ReplaceColor() Dim shape As shape Dim slide As slide Dim txt As TextRange On Error Resume Next
打开关闭工作簿等 1 Sub 打开工作簿() 2 Dim sFilePath As String 3 sFilePath = "D:\A.xls" 4 Dim oWB As Workbook 5 Set oWB = Excel.Workbooks.Open(sFilePath, ReadOnly:=False, writerespassword:="123") 6 delay (5) 7 If Not oWB.ReadOnly Then 8 9 oWB.Close
'-------------------一覧取得----------------------------- Sub getRedmineGrid_Click() Dim wb As Workbook Dim sheet As Worksheet Dim path As String path = ThisWorkbook.path & "\issues.xls" If Dir(path) = "" Then FileCopy ThisWorkbook.pat
打开PPT,按ALT+F11打开VBA编辑器,(部分电脑FN+ALT+F11)在左面的工程视图里点击右键,选择插入->模块,添加一个模块,名字都不用改. 然后点击顶部的"工具"菜单,选择引用,找"Microsoft Word X.0 Object Library"(其中X与你的OFFICE版本有关),钩上,点确定 将下列代码贴到刚建立的模块里,按F5(部分电脑FN+F5)即可 Sub Main() On Error Resume Next Dim temp A