Option Explicit '=========================================================== ' 入力情報(シート)取得 ' Ver 1.0 ' [戻り値]: ' String ' 取得したパラメータ値 ' [引 数]: ' isSheetName(String) ' 取得するシート名 ' isParNameString(String) ' パラメータ名 '=========================================================== Function getSysParaBySheet( _ isSheetName As String _ , isParNameString As String _ ) As String Const csSysParaKeyMark As String = "[@@KEY@@]" Dim lsRet As String Dim loSheetControl As New cSheetControl If (loSheetControl.Initialize(isSheetName) = False) Then getSysParaBySheet = "" Exit Function Else If (loSheetControl.isCheckFoundSheet() = False) Then getSysParaBySheet = "" Exit Function End If End If Dim lsSearchItemString As String lsSearchItemString = _ Replace(csSysParaKeyMark, "KEY", isParNameString) Dim loSheetTarget As Worksheet Set loSheetTarget = Worksheets(isSheetName) If (loSheetTarget.Cells.Find(lsSearchItemString) Is Nothing) Then lsRet = "" Else Dim lvFoundCelPosition As Variant Set lvFoundCelPosition = loSheetTarget.Cells( _ loSheetTarget.Cells.Find(lsSearchItemString).Row, _ loSheetTarget.Cells.Find(lsSearchItemString).Column _ ) lsRet = _ Right( _ lvFoundCelPosition, _ Len(lvFoundCelPosition) - Len(lsSearchItemString) _ ) End If getSysParaBySheet = lsRet End Function '=========================================================== ' テスト用 '=========================================================== Sub call_getSysParaBySheet() MsgBox _ getSysParaBySheet(Cells(5, 5), Cells(6, 5) _ ) End Sub