2021-03-07から1日間の記事一覧
■フォルダ内のファイル件数を確認する 呼び出し元プロシージャ Sub subFileCount() Dim strPath As String Dim intFilesCount As Integer strPath = "C:\Users\デスクトップ\テスト" intFilesCount = getFileCount(strPath) MsgBox intFilesCount End Sub フ…
■指定したパスのフォルダ内のサブフォルダをカウントし、総件数を返す 呼び出し元プロシージャ Sub subFolderCount() Dim strPath As String Dim intSubFoldersCount As Integer strPath = "C:\Users\デスクトップ\テスト" intSubFoldersCount = getSubFolde…
呼び出し元プロシージャ Sub Try() Dim strPath As String Dim strFolderName As String strPath = "C:\Users\デスクトップ\テスト.xlsm" strFolderName = getParentFolderPath(strPath) MsgBox strFolderName End Sub ファンクションプロシージャ Function …
呼び出し元プロシージャ Sub Try() Dim strPath As String Dim strBaseFileName As String strPath = "C:\Users\デスクトップ\テスト.xlsm" strBaseFileName = getBaseFileName(strPath) MsgBox strBaseFileName End Sub ファンクションプロシージャ Functio…
呼び出し元プロシージャ Sub Try() Dim strPath As String Dim strFileName As String strPath = "C:\Users\デスクトップ\テスト.xlsm" strFileName = gefFileName(strPath) MsgBox strFileName End Sub ファンクションプロシージャ Function gefFileName(st…
■指定したファイルパスより拡張子を取得する 呼び出し元プロシージャ Sub テスト() Dim strPath As String Dim strExtension As String strPath = "C:\デスクトップ\テスト.xlsm" strExtension = getExtension(strPath) MsgBox strExtension End Sub ファン…