- ©«¤l
- 472
- ¥DÃD
- 5
- ºëµØ
- 0
- ¿n¤À
- 485
- ÂI¦W
- 0
- §@·~¨t²Î
- Windows
- ³nÅ骩¥»
- MS Office
- ¾\ŪÅv
- 100
- ©Ê§O
- ¨k
- ¨Ó¦Û
- »´ä
- µù¥U®É¶¡
- 2010-7-4
- ³Ì«áµn¿ý
- 2014-12-28
|
¤½¥q¦³¤@¨Ç¥dÄÁ¸ê®Æ
¨Ò¦p:20100826,0827,1234
20100826,0844,3586
20100826,1844,7896
¤å ...
anotny µoªí©ó 2010-8-30 21:39
¤èªk¦³«Ü¦h, ³oÓ¬O¿ï¤W¤åÀɪ½±µ¶×¤J-
- sub test()
- Dim filename As String
- With Application.FileDialog(msoFileDialogOpen)
- .AllowMultiSelect = False
- .Show
- If .SelectedItems.Count > 0 Then
- filename = .SelectedItems(1)
- Else
- Exit Sub
- End If
- End With
-
- Dim oFSO
- Set oFSO = CreateObject("Scripting.FileSystemObject")
- Set sdmax = CreateObject("Scripting.Dictionary")
- Set sdmin = CreateObject("Scripting.Dictionary")
- Dim strDate As String
- Dim strTime As String
- Dim strNo As String
- Set oFS = oFSO.OpenTextFile(filename)
- Do Until oFS.AtEndOfStream
- sText = oFS.ReadLine
- strDate = Split(sText, ",")(0)
- strTime = Split(sText, ",")(1)
- strNo = Split(sText, ",")(2)
-
- If sdmin.exists(strNo) Then
- sdmax(strNo) = strTime
- Else
- sdmin.Add strNo, strTime
- sdmax.Add strNo, strTime
- End If
-
- Loop
-
- Range("A1").Resize(sdmin.Count, 1).Value = Application.Transpose(sdmin.keys)
- Range("B1").Resize(sdmin.Count, 1).Value = Application.Transpose(sdmin.items)
- Range("C1").Resize(sdmin.Count, 1).Value = Application.Transpose(sdmax.items)
- Set sdmin = Nothing
- Set sdmax = Nothing
- oFS.Close
- oFSO = Null
- end sub
½Æ»s¥N½X |
|