
Excel与VBA
Mikowoo007
这个作者很懒,什么都没留下…
展开
-
VBA代码
一个简单VBA-DemoSub VBA_Demo() Dim Total As Long, i As Long Total = 0 For i = 1 To 100 Total = Total + 1 Next i MsgBox TotalEnd Sub声明变量Sub VariantDemo()' 声明变量,默认为Variant...原创 2019-05-11 17:23:35 · 786 阅读 · 0 评论 -
ppt使用vba
Sub 插入()Dim filename As StringDim file_add As StringDim file_suffix As StringDim index_name As Stringfile_path = "C:\Users\mikowoo\Desktop\001\result\"file_suffix = ".pdf"For i = 1 To 111 ...原创 2019-04-04 14:28:51 · 4699 阅读 · 3 评论 -
VBA--数据中有空值时求均值--模板
excel数据中有空值根据不同条件,求均值Sub test()standard = Array(1, 2, 3, 4, 5)Dim result As Long, Count As Long, Sum As Long For r = 0 To 4 'For x = 2 To 18 Count = 0 Sum = 0 ...原创 2019-03-27 18:09:44 · 763 阅读 · 0 评论 -
VBA--对文件夹下的每张报表再次赋值(2)
Sub OpenAndClose()Dim MyFile As StringDim Arr(1000) As StringDim count As IntegerMyFile = Dir("C:\Users\mikowoo\Desktop\EPSreport\second\result\" & "*.xlsx")count = count + 1Arr(count) = MyF...原创 2019-03-27 18:05:46 · 258 阅读 · 0 评论 -
VBA-- 从汇总表中求指标值_并赋值给每张报表(1)
Public wb_data As Excel.WorkbookSub test() result = Array("G18", "G32", "G42", "G45", "G56", "G58", "G71", "N13", "N16", "N17", "N18", "N31", "N33", "N42", "N44", "N46", "N47", "N48", "N60", "N61...原创 2019-03-27 18:03:07 · 358 阅读 · 0 评论 -
VBA--遍历文件夹下所有文件--模板
遍历文件夹下所有文件并输出文件名Sub OpenAndClose() Dim MyFile As String Dim Arr(1000) As String Dim count As Integer MyFile = Dir("C:\Users\mikowoo\Desktop\EPSreport\result\" & "*.xlsx") coun...原创 2019-03-27 17:57:53 · 7461 阅读 · 0 评论 -
VBA数据处理的小项目应用--横项求有空值的均值
Sub test() result = Array("G35", "N23", "N31") mole_arr = Array(32, 29, 68) '分子 deno_arr = Array(29, 23, 65) '分母 Dim cell_result As Variant, mole_result As Variant, deno_result As Vari...原创 2019-03-19 17:28:59 · 270 阅读 · 0 评论