- ©«¤l
- 549
- ¥DÃD
- 152
- ºëµØ
- 0
- ¿n¤À
- 691
- ÂI¦W
- 0
- §@·~¨t²Î
- WIN7
- ³nÅ骩¥»
- OFFICE 2010
- ¾\ŪÅv
- 50
- ©Ê§O
- ¨k
- µù¥U®É¶¡
- 2013-8-10
- ³Ì«áµn¿ý
- 2022-9-7
 
|
¦^´_ 8# Hsieh
¤j¤j±z¦n,§Ú·Q³z¹L±zªºµ{¦¡½X,¦Û°Ê§ä¨ì[Ó¤H¥¨¶°¬¡¶Ã¯]ªº¦ì¸m
¦ý¹J¨ì2Ó°ÝÃD
1.(Åv°ÝÃD),¦]Ó¤H¥¨¶°¬¡¶Ã¯À³¸Ó¤£·|©ñ¨ìÅvªº¸ê®Æ§¨¸Ì±,¦]¦¹§Ú¼g¤@ÓON ERROR RESUME NEXT ¸õ¹L
2.§ä¤£¨ì[XLSTART]¸ê®Æ§¨...WHY?- Sub list_and_link1()
- Dim ary() As String, rw As Long
- rw = 1: i = 0
- path1 = "C:\" '²Ä¤@¼h¸ê®Æ§¨
- file1 = Dir(path1 & "*.*", vbDirectory) '¥u³B²z¸ê®Æ§¨
- Do While file1 <> ""
- If file1 <> "." And file1 <> ".." And _
- GetAttr(path1 & file1) = vbDirectory Then
- i = i + 1
- ReDim Preserve ary(i)
- ary(i) = file1
- End If
- file1 = Dir
- Loop
- For i = 1 To UBound(ary)
- GetSubs path1 & ary(i) & "\", rw, 1
- Next i
- End Sub
- Sub GetSubs(sPath As String, rw As Long, ilevel As Long)
- Dim ary1() As String
- ReDim ary1(1)
- On Error Resume Next
- sname = ""
- sname = Dir(sPath, vbDirectory)
- On Error GoTo 0
- Do While sname <> ""
- If sname <> "." And sname <> ".." And _
- GetAttr(sPath & sname) = vbDirectory Then
- ary1(UBound(ary1)) = sname
- ReDim Preserve ary1(UBound(ary1) + 1)
- End If
- sname = Dir
- Loop
- For i = 1 To UBound(ary1) - 1
- rw = rw + 1
- GetSubs sPath & ary1(i) & "\", rw, ilevel + 1
- If ary1(i) = "XLSTART" Then
- Sheets("LOG").[E1] = sPath & ary1(i)
- End
- End If
- Next i
- End Sub
½Æ»s¥N½X |
|