°»´ú"1.xls"ÀɬO§_§e¥´¶}ª¬ºA?
- ©«¤l
- 258
- ¥DÃD
- 77
- ºëµØ
- 0
- ¿n¤À
- 385
- ÂI¦W
- 0
- §@·~¨t²Î
- Win7
- ³nÅ骩¥»
- Office2010
- ¾\ŪÅv
- 20
- ©Ê§O
- ¨k
- ¨Ó¦Û
- Taiwan
- µù¥U®É¶¡
- 2010-8-8
- ³Ì«áµn¿ý
- 2021-1-25
|
°»´ú"1.xls"ÀɬO§_§e¥´¶}ª¬ºA?
½Ð±Ð¦U¦ì¤j¤j:
Ó¤H¦b¥ÎVBA¥´¶}¥t¥~ExcelÀɦp"1.xls"ÀÉ,Y³{"1.xls"ÀÉ¥»¨Ó´N¤w§e¥´¶}ª¬ºA®É,´N¤£¤Ó«ê·í¡C
½Ð±Ð¦U¦ì¥ý¶iYn°»´ú"1.xls"ÀɬO§_§e¥´¶}ª¬ºA?À³¦p¦ó¹B¥ÎVBA»yªk? |
|
|
|
|
|
|
- ©«¤l
- 17
- ¥DÃD
- 3
- ºëµØ
- 0
- ¿n¤À
- 33
- ÂI¦W
- 0
- §@·~¨t²Î
- XP SP3
- ³nÅ骩¥»
- Office 2007
- ¾\ŪÅv
- 10
- ©Ê§O
- ¨k
- µù¥U®É¶¡
- 2011-4-30
- ³Ì«áµn¿ý
- 2012-12-21
|
«Øij¤@¶}©l´N±N¡A¸ô®|»PÀɦW³]©w¦¨¤£¦PÅܼơC¤è«K¤§«á§Q¥Î¡C
¥t¥~
'¨ú±o¸ô®|»PÀɦW(¤£¥]¬A°ÆÀɦW)
'The following function returns the filename without the extension from the file's full path:
Function FileNameNoExt(strPath As String) As String
Dim strTemp As String
strTemp = Mid$(strPath, InStrRev(strPath, "\") + 1)
FileNameNoExt = Left$(strTemp, InStrRev(strTemp, ".") - 1)
End Function
'¨ú±o§¹¾ãÀɦW
'The following function returns the filename with the extension from the file's full path:
Function FileNameWithExt(strPath As String) As String
FileNameWithExt = Mid$(strPath, InStrRev(strPath, "\") + 1)
End Function
'¨ú±o¸ô®|
'the following function will get the path only (i.e. the folder) from the file's ful path:
Function FilePath(strPath As String) As String
FilePath = Left$(strPath, InStrRev(strPath, "\"))
End Function |
|
|
|
|
|
|
- ©«¤l
- 17
- ¥DÃD
- 3
- ºëµØ
- 0
- ¿n¤À
- 33
- ÂI¦W
- 0
- §@·~¨t²Î
- XP SP3
- ³nÅ骩¥»
- Office 2007
- ¾\ŪÅv
- 10
- ©Ê§O
- ¨k
- µù¥U®É¶¡
- 2011-4-30
- ³Ì«áµn¿ý
- 2012-12-21
|
«Øij¤@¶}©l´N±N¡A¸ô®|»PÀɦW³]©w¦¨¤£¦PÅܼơC¤è«K¤§«á§Q¥Î¡C
¥t¥~
'The following function returns the filename without the extension from the file's full path:
Function FileNameNoExt(strPath As String) As String
Dim strTemp As String
strTemp = Mid$(strPath, InStrRev(strPath, "\") + 1)
FileNameNoExt = Left$(strTemp, InStrRev(strTemp, ".") - 1)
End Function
'The following function returns the filename with the extension from the file's full path:
Function FileNameWithExt(strPath As String) As String
FileNameWithExt = Mid$(strPath, InStrRev(strPath, "\") + 1)
End Function
'¨ú±o¸ô®|
'the following function will get the path only (i.e. the folder) from the file's ful path:
Function FilePath(strPath As String) As String
FilePath = Left$(strPath, InStrRev(strPath, "\"))
End Function |
|
|
|
|
|
|
- ©«¤l
- 258
- ¥DÃD
- 77
- ºëµØ
- 0
- ¿n¤À
- 385
- ÂI¦W
- 0
- §@·~¨t²Î
- Win7
- ³nÅ骩¥»
- Office2010
- ¾\ŪÅv
- 20
- ©Ê§O
- ¨k
- ¨Ó¦Û
- Taiwan
- µù¥U®É¶¡
- 2010-8-8
- ³Ì«áµn¿ý
- 2021-1-25
|
¦^´_ 18# Hsieh
ÁÂÁ §¹¥þ¤F¸Ñ |
|
|
|
|
|
|
- ©«¤l
- 258
- ¥DÃD
- 77
- ºëµØ
- 0
- ¿n¤À
- 385
- ÂI¦W
- 0
- §@·~¨t²Î
- Win7
- ³nÅ骩¥»
- Office2010
- ¾\ŪÅv
- 20
- ©Ê§O
- ¨k
- ¨Ó¦Û
- Taiwan
- µù¥U®É¶¡
- 2010-8-8
- ³Ì«áµn¿ý
- 2021-1-25
|
|
|
|
|
|
|
- ©«¤l
- 258
- ¥DÃD
- 77
- ºëµØ
- 0
- ¿n¤À
- 385
- ÂI¦W
- 0
- §@·~¨t²Î
- Win7
- ³nÅ骩¥»
- Office2010
- ¾\ŪÅv
- 20
- ©Ê§O
- ¨k
- ¨Ó¦Û
- Taiwan
- µù¥U®É¶¡
- 2010-8-8
- ³Ì«áµn¿ý
- 2021-1-25
|
¦^´_ 14# GBKEE
Á¤F
if Ucase(filename)="FALSE" then
»P
if filename=False then
¥i¦³¬Û²§ |
|
|
|
|
|
|
- ©«¤l
- 5923
- ¥DÃD
- 13
- ºëµØ
- 1
- ¿n¤À
- 5986
- ÂI¦W
- 0
- §@·~¨t²Î
- win10
- ³nÅ骩¥»
- Office 2010
- ¾\ŪÅv
- 150
- ©Ê§O
- ¨k
- ¨Ó¦Û
- ¥xÆW°ò¶©
- µù¥U®É¶¡
- 2010-5-1
- ³Ì«áµn¿ý
- 2022-1-23
|
¦^´_ 13# yangjie - Option Explicit
- Sub ¿ï¾ÜÀɦW¶×¤J()
- Dim Path1, Str1 As String
- Dim wb As Workbook
- Dim Filt As String
- Dim FilterIndex As Integer
- Dim Title As String
- '---------------------------------
- Dim xlfileName As String, xlFullName As String
- 'ק﫬ºA As String xlfileName:¨S¦³¸ô®|
- Dim MyPath
- MyPath = CurDir '¬ö¿ý즳ªº¥Ø¿ý©ÎÀɮק¨¡C
- Path1 = Application.ActiveWorkbook.Path
- ' Path1 = "C:\WINDOWS\SYSTEM"
- ChDrive Split(Path1, ":")(0) 'ChDrive ³¯z¦¡ §ïÅܥثeªººÏºÐ¾÷¡C
- ChDir Path1 'ChDir ³¯z¦¡ §ïÅܥثeªº¥Ø¿ý©ÎÀɮק¨¡C
- '½Ðª`·N ChDir ³¯z¦¡·|§ïÅܲ{¦³¥Ø¿ý¦ì¸m¡A¦ý¤£·|§ïÅܺϺо÷¦ì¸m¡A
- '¨Ò¦p¡A¦pªG²{¦bªººÏºÐ¾÷¬O C¡A³¯z¦¡±N²{¦³¥Ø¿ý¤Á´«¨ìºÏºÐ¾÷ D¡A¦ý¬O C ¤´µM¬O²{¦³ªººÏºÐ¾÷¦ì¸m¡G
- Filt = "Excel Files (*.xls),*.xls"
- FilterIndex = 5
- Title = "Select a File for Import"
- xlFullName = Application.GetOpenFilename _
- (FileFilter:=Filt, _
- FilterIndex:=FilterIndex, _
- Title:=Title)
-
- If UCase(xlFullName) = "FALSE" Then
- MsgBox "No file was selected."
- Exit Sub
- End If
- '''''''''''''''''''''''''
- ChDrive Split(MyPath, ":")(0) '§ïÅܬ°ì¦³ªººÏºÐ¾÷¡C
- ChDir MyPath '§ïÅܬ°ì¦³ªº¥Ø¿ý©ÎÀɮק¨¡C
- ''''''''''''''''''''''''''
-
- xlfileName = Split(xlFullName, "\")(UBound(Split(xlFullName, "\")))
- '°}¦C(¤W¤¸¯À¼Æ) ¨úªºÀɮצWºÙ¨S¦³¸ô®|
- If IsOpen(xlfileName) <> False Then
- Workbooks(xlfileName).Activate
- Else
- Set wb = Workbooks.Open(xlFullName, True, False)
- End If
- f_bookname2 = ActiveWorkbook.Name
- Windows(f_bookname2).Activate
- Sheets(1).Activate
- End Sub
- Function IsOpen(Fs As String) As Boolean
- IsOpen = False
- For Each W In Windows
- If W.Caption = Fs Then IsOpen = True: Exit For
- Next
- End Function
½Æ»s¥N½X |
|
|
|
|
|
|