2009-06-05 [VBA][Excel][Function] 判斷檔案是否存在 9316 0 VBA 2009-06-08 摘要:[VBA][Function] 判斷是否檔案存在 'Description:判斷是否檔案存在 - Ver. 1.00 'Parameters:strFile 檔案完整路徑 'Retrun:Boolean 'Package: 'Reference: 'Creater:Darren.NET - 2009/04/23 'Modify: Public Function F_File_isExist(strFile As String) As Boolean Dim fs As Object Set fs = CreateObject("Scripting.FileSystemObject") FileExist = fs.FileExists(strFile) End Function Public Function F_Row_GetCellTxt(ws As Worksheet, intRow As Integer, intColStart As Integer, intColEnd As Integer, strSplitChr As String, strSplitHalf As String) As String Dim i As Integer Dim rg As Range Dim strCellTxt, strCellLoc As String For i = intColStart To intColEnd Set rg = ws.Cells(intRow, i) If Left(Trim(rg.Text), 2) = "$#" Then If strCellTxt = "" Then strCellTxt = Trim(rg.Text) Else: strCellTxt = strCellTxt & strSplitChr & Trim(rg.Text) End If If strCellLoc = "" Then strCellLoc = rg.Address(False, False) 'ex.A1 Else: strCellLoc = strCellLoc & strSplitChr & rg.Address(False, False) End If End If Next F_Row_GetCellTxt = strCellTxt & strSplitHalf & strCellLoc End Function VBA Excel Function 回首頁