Sub 按钮1_Click()
Dim wba As Workbook
Dim shta As Worksheet
Dim ak(1 To 2000) As String
i =1
Dim fil As Stringfil = Dir(ThisWorkbook.Path &"\*.xls*")Do While fil <>""ak(i)= fili = i +1fil = DirLoopSet wba = ThisWorkbook
Set shta = wba.Worksheets(1)
shta.Range("A2:A3000").ClearContents
shta.Range("C2:A3000").ClearContents
shta.Range("D2:A3000").ClearContentsi =0
j =2
For Each file In aki = i +1If Trim(file)<>"程序文件.xlsm" And Trim(file)<>"~$程序文件.xlsm" And Trim(file)<>"" Thenstr1 = Split(file,".")sname = str1(0)shta.Cells(j,1)= snameshta.Cells(j,1).Select'Selection = fso.GetBaseName(file)folder_location = ThisWorkbook.Path & "\" &fileshta.Hyperlinks.Add anchor:=Selection, Address:=folder_locationWith Selection.Font.Size =14.Strikethrough =False.Superscript =False.Subscript =False.OutlineFont =False.Shadow =False.TintAndShade =0.ThemeFont = xlThemeFontNoneEnd Withj = j +1End If
Next
'wba.Save
End Sub
Sub 汇总()
Dim wba As Workbook
Dim shta As Worksheet
Dim wb As Workbook
Dim sht As Worksheet
Dim snum As Long
Dim ak(1 To 2000) As String
Dim dic As Object
Set dic = CreateObject("scripting.dictionary")
i =1
Dim fil As Stringfil = Dir(ThisWorkbook.Path &"\*.xls*")Do While fil <>""ak(i)= fili = i +1fil = DirLoopSet wba = ThisWorkbook
Set shta = wba.Worksheets(1)For Each file In ak
Application.DisplayAlerts =False
Application.ScreenUpdating =FalseIf Trim(file)<>"" And Trim(file)<>"程序文件.xlsm" ThenSet wb = Workbooks.Open(ThisWorkbook.Path & "\" &file)Set sht = wb.Worksheets(1)snum =0gint =2For j =2 To 2000If Trim(sht.Cells(j,1))<>"" Thensht.Cells(j,8)= CInt(sht.Cells(j,4))- CInt(sht.Cells(j,5))- CInt(sht.Cells(j,6))snum = sht.Cells(j,8)+ snumElseIf Trim(sht.Cells(j,1))="" Thensht.Range("K2")= snumFor ji =2 To 2000If Trim(sht.Cells(ji,12))<>"" And Trim(sht.Cells(ji,13))<>"" Then '股东姓名sht.Cells(ji,14)= CDbl(sht.Range("K2"))* CDbl(sht.Cells(ji,13))strname = Trim(sht.Cells(ji,12))If dic.Exists(strname) Thendic.Item(strname)= CDbl(dic(strname))+ CDbl(sht.Cells(ji,14).Value)Elsedic.Item(strname)= CDbl(sht.Cells(ji,14).Value)End IfElseExit ForEnd IfNext jiExit ForEnd IfNext jwb.Savewb.CloseEnd IfApplication.DisplayAlerts =True
Application.ScreenUpdating =TrueNext
shta.Range("C2:C5000").ClearContents
shta.Range("D2:D5000").ClearContentsshta.Range("C2").Resize(dic.Count)= Application.Transpose(dic.keys)
shta.Range("D2").Resize(dic.Count)= Application.Transpose(dic.items)
End Sub
第三题:BALANCING BACTERIA
标签:思维、差分
题意:给定 n n n个数, a 1 , a 2 , a 3 . . . a n a_1,a_2,a_3...a_n a1,a2,a3...an,每次操作 可以选择数字 L ( 1 < L < n ) L…
1. 创建数组:New[type]Array
/**
新建数组
length: the array length.
RETURNS:
Returns a Java array, or NULL if the array cannot be constructed.
*/
jbyteArray javaArray env->NewByteArray(1024*1024);New[PrimitiveType]Array RoutinesArray TypeNewB…
前言
当涉及到高级参数传递方式时,有几种常见的技术可以在 C 中使用。下面是对每种技术的详细介绍,并附带示例说明:
1. 指针的引用(Reference to Pointer)
指针的引用允许在函数内部修改指针本身,而不仅…
data
首先导入torch里面专门做图形处理的一个库,torchvision,根据官方安装指南,你在安装pytorch的时候torchvision也会安装。
我们需要使用的是torchvision.transforms和torchvision.datasets以及torch.utils.data.DataLoader
首先DataLoa…