ray88’s diary

お仕事で困ったとき用の自分用の覚書

Temp_ボタン処理

Option Explicit

Sub selectFolderPath()
  '------------------------------------------------------
  '機能:ダイアログを表示し、選択したフォルダのパスを返す
  '------------------------------------------------------
    Dim targetPath As String
    Dim objDialog As Object   'FileDialogオブジェクト格納用
    
    'FileDialogオブジェクトをインスタンス化
    Set objDialog = Application.FileDialog(msoFileDialogFolderPicker)
    
    'ダイアログを開いて選択したフォルダを親フォルダパスに指定
    If objDialog.Show Then
        targetPath = objDialog.SelectedItems(1)
        
        Sheets("Sheet1").Range("C3") = targetPath
    Else
        MsgBox "フォルダ選択キャンセル"
    End If
End Sub

Sub MainProcessExcute()
'-----------------------------------
'機能:メインプロセスを実行する
'-----------------------------------
    Call Main

End Sub
Sub 稟議ファイル有無結果クリア()

    Sheets(strToolSheetName).Select
     With Sheets(strToolSheetName)
        .Range(strRingiNoReultCell & ":" & strRingiNoCauseErrCell).ClearContents
     End With
    
End Sub
Sub 一覧表をクリア()
'----------------------------------
'機能:一覧表をクリアする
'----------------------------------
    Dim intListRow As String
    Dim intRow As String
    
    Sheets(strToolSheetName).Select
    
    With Sheets(strToolSheetName)
        intListRow = .Cells(Rows.Count, intSubFolderColumn).End(xlUp).Row
        If intListRow < intSubFolderStartRow Then
            intListRow = intSubFolderStartRow
        End If
        .Range(Cells(intSubFolderStartRow, intSubFolderColumn), Cells(intListRow, intCauseErrrColumn)).ClearContents
    End With
    
End Sub

Sub 派遣会社フォルダパスをクリア()

    Sheets(strToolSheetName).Range(strParentFolderCell).ClearContents

End Sub
Sub ファイル名とシート名に含む文言クリア()
    
        Sheets(strToolSheetName).Range(strSeikyuFileNameCell & ":" & strMeisaiSheetNameCell).ClearContents
        
End Sub
Sub 派遣会社フォルダパス以外をクリア()

    Call ファイル名とシート名に含む文言クリア
    
    Call 一覧表をクリア
    
End Sub
Sub 全てクリア()
    Call 派遣会社フォルダパスをクリア
    
    Call ファイル名とシート名に含む文言クリア
    
    Call 一覧表をクリア
End Sub