|
楼主 |
发表于 2024-4-25 19:17
|
显示全部楼层
- Sub lll()
- Dim Dict As Dictionary
- Dim ii
- Dim Arr
- Dim oDate
- oDate = Now()
- Set Dict = New Dictionary
- For ii = 1 To 4
- Dict("第" & ii) = Array(oDate, "A" & ii, "B" & ii, "C" & ii, Rnd(1) * 10000)
- oDate = oDate + 10
- Next ii
- Debug.Print Dict.Keys(1)
- Sheet1.Cells(10, 9).Resize(4, 1) = Application.WorksheetFunction.Transpose(Dict.Keys)
- Arr = Application.WorksheetFunction.Transpose(Dict.Items)
- Sheet1.Cells(10, 10).Resize(4, 3) = Application.WorksheetFunction.Transpose(Arr)
-
- With Application.WorksheetFunction
- Sheet1.Cells(20, 10).Resize(4, 5) = .Transpose(.Transpose(Dict.Items))
- End With
-
- Stop
- End Sub
复制代码
|
|