- Function K9BaseDateArr()
- Dim Arr(29)
- Arr(0) = Array("车站", "路段", "时间", "行驶时间", "行驶距离")
- Arr(1) = Array("三灶车场", "琴石路", 0.572916666666667, "发车", "<1千米")
- Arr(2) = Array("映月新村", "映月路", 0.574305555555556, "2分钟", "<1千米")
- Arr(3) = Array("唐人街", "伟民路", 0.575694444444444, "4分钟", "<1千米")
- Arr(4) = Array("月堂", "金海岸大道西", 0.577083333333333, "6分钟", "1.2千米")
- Arr(5) = Array("中南修理厂", "金海岸大道西", 0.577777777777778, "7分钟", "1.6千米")
- Arr(6) = Array("鱼弄", "金海岸大道东", 0.579861111111111, "10分钟", "2.7千米")
- Arr(7) = Array("城建总公司", "金海岸大道东", 0.580555555555556, "11分钟", "3.6千米")
- Arr(8) = Array("斜尾", "金岛路", 0.581944444444444, "13分钟", "3.9千米")
- Arr(9) = Array("金沙湾豪庭", "金岛路", 0.582638888888889, "14分钟", "4.7千米")
- Arr(10) = Array("金海岸中学", "金岛路", 0.583333333333333, "15分钟", "5.2千米")
- Arr(11) = Array("金都大厦", "金岛路", 0.584027777777778, "16分钟", "5.6千米")
- Arr(12) = Array("金岛路东", "金岛路", 0.585416666666667, "18分钟", "6.0千米")
- Arr(13) = Array("东咀", "金岛路", 0.586111111111111, "19分钟", "6.4千米")
- Arr(14) = Array("青湾", "金湾路(S272)", 0.588194444444444, "22分钟", "7.8千米")
- Arr(15) = Array("金湾高尔夫", "金湾路(S272)", 0.590277777777778, "25分钟", "9.8千米")
- Arr(16) = Array("二号闸", "金湾路(S272)", 0.592361111111111, "28分钟", "11千米")
- Arr(17) = Array("时代山湖海", "金湾路(S272)", 0.59375, "30分钟", "12千米")
- Arr(18) = Array("保利香槟", "金湾路(S272)", 0.594444444444444, "31分钟", "13千米")
- Arr(19) = Array("湖心路口", "珠海大道中(S366)", 0.596527777777778, "34分钟", "14千米")
- Arr(20) = Array("翠湾", "珠海大道西(S366)", 0.607638888888889, "50分钟", "26千米")
- Arr(21) = Array("华发新城", "珠海大道西(S366)", 0.613888888888889, "59分钟", "33千米")
- Arr(22) = Array("白石(银石雅园)", "九洲大道西(S366)", 0.617361111111111, "1小时4分钟", "35千米")
- Arr(23) = Array("兰埔(富华里)", "九洲大道西(S366)", 0.618055555555556, "1小时5分钟", "36千米")
- Arr(24) = Array("隧道南", "迎宾南路", 0.621527777777778, "1小时10分钟", "37千米")
- Arr(25) = Array("柠溪", "柠溪路", 0.624305555555556, "1小时14分钟", "39千米")
- Arr(26) = Array("香宁花园", "柠溪路", 0.627083333333333, "1小时18分钟", "40千米")
- Arr(27) = Array("南香里", "柠溪路", 0.628472222222222, "1小时20分钟", "41千米")
- Arr(28) = Array("南坑", "紫荆路", 0.629166666666667, "1小时21分钟", "42千米")
- Arr(29) = Array("香洲", "紫荆路", 0.630555555555556, "1小时23分钟", "42千米")
- K9BaseDateArr = Arr
- End Function
- Sub Ll()
- Dim UnionDict As Scripting.Dictionary
- Set UnionDict = New Scripting.Dictionary
-
- Dim Str, Arr
- Arr = K9BaseDateArr
- Dim Pres As Presentation
- Set Pres = Application.ActivePresentation
- Dim Sld As Slide, Slds As Slides
- Set Slds = Pres.Slides
- Dim Shp As Shape, Shps As Shapes, oTab As Table
- Set Sld = Slds(1)
- For ii = Sld.Shapes.Count To 1 Step -1
- Set Shp = Sld.Shapes(ii)
- Shp.Delete
- Next ii
- Dim oRow, oCol, Ll, Tt, Ww, Hh
- oRow = (UBound(Arr) + 1)
- oCol = 6
- Ll = 10
- Tt = 5
- With Pres.PageSetup
- Ww = .SlideWidth * 2 / 3
- Hh = .SlideHeight
- End With
- Set Shps = Sld.Shapes
- Set oTab = Shps.AddTable(oRow, oCol, Ll, Tt, Ww, Hh).Table
- Set Shp = Shps(Shps.Count)
- SetTable oTab, Arr
- Shp.Name = "L9Table"
- For Each Shp In Sld.Shapes
- Debug.Print Shp.Name, Shp.Type
- Next Shp
-
- End Sub
- Function SetTable(oTable As Table, Arr)
- Dim Dict As Scripting.Dictionary
- Set Dict = New Scripting.Dictionary
- Dim Str, oStr
- With oTable
-
- For ii = 0 To UBound(Arr)
- If ii > 0 Then
- .Cell(ii + 1, 1).Shape.TextFrame2.TextRange.Text = ii
- End If
- For jj = 0 To 4
- If jj = 2 Then
- .Cell(ii + 1, jj + 2).Shape.TextFrame2.TextRange.Text = Format(Arr(ii)(jj), "h:mm")
- Else
- .Cell(ii + 1, jj + 2).Shape.TextFrame2.TextRange.Text = Arr(ii)(jj)
- End If
- If jj = 1 Then
- Dict(Arr(ii)(jj)) = Dict(Arr(ii)(jj)) & "," & ii
- End If
- Next jj
- Next ii
- '.Cell(5, 3).Merge .Cell(8, 3)
-
- End With
-
-
- With Dict
- For ii = 0 To .Count - 1
- Debug.Print .Keys(ii),
- Str = .Items(ii)
- Str = Mid(Str, 2, Len(Str))
- ss = Split(Str, ",")
- If UBound(ss) > 1 Then
-
- Debug.Print ss(0), ss(UBound(ss))
-
- oTable.Cell(ss(0) + 1, 3).Merge oTable.Cell(ss(UBound(ss)) + 1, 3)
-
- End If
-
- Next ii
- End With
- End Function
复制代码
|