|
- Sub 圆角矩形1_Click()
- arr = Sheets("报名表").UsedRange
- Set d = CreateObject("scripting.dictionary")
- For i = 2 To UBound(arr)
- If arr(i, 2) <> "" Then
- m = Replace(Month(arr(i, 1)), "月", "") '获取月
- dd = Replace(Day(arr(i, 1)), "日", "") '获取日
- sp = Split(arr(i, 2), "、") '名单
- For x = 0 To UBound(sp) '名单装入字典
- d(sp(x)) = arr(i, 3)
- Next x
- With Sheets(m) '对应月份的表
- brr = .Range("B4:AG" & .Cells(Rows.Count, 2).End(3).Row - 1)
- For j = 4 To UBound(brr)
- brr(j, Val(dd) + 1) = d(brr(j, 1)) '根据名单写入工时
- Next j
- .Range("B4").Resize(UBound(brr), UBound(brr, 2)) = brr '数组写入工作表
- End With
- d.RemoveAll '清空字典
- End If
- Next i
- Set d = Nothing
- MsgBox "运行完毕"
- End Sub
复制代码 |
|