fix: 選択営業所/物件状況チェックの型不一致エラー(実行時エラー13)を解消
Range(...).Valueが配列やエラー値を返すケースでTrimが型不一致エラーになっていた。 Cells(1,1)で単一セル値を取得し、IsErrorチェック+CStrで文字列化してから判定するよう修正。 Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
parent
bc03b2d47b
commit
b9150c0461
@ -22,7 +22,13 @@ Sub run()
|
||||
Call init
|
||||
|
||||
'入力チェック(営業所・物件状況が未選択なら処理中断)
|
||||
If Trim(Range("‘I‘ð‰c‹Æ<E280B9>Š").Value) = "" Or Trim(Range("•¨Œ<C2A8><C592>ó‹µ").Value) = "" Then
|
||||
Dim selSalesOffice As Variant, selPropertyStatus As Variant
|
||||
selSalesOffice = Range("‘I‘ð‰c‹Æ<E280B9>Š").Cells(1, 1).Value
|
||||
selPropertyStatus = Range("•¨Œ<C2A8><C592>ó‹µ").Cells(1, 1).Value
|
||||
If IsError(selSalesOffice) Then selSalesOffice = ""
|
||||
If IsError(selPropertyStatus) Then selPropertyStatus = ""
|
||||
|
||||
If Trim(CStr(selSalesOffice)) = "" Or Trim(CStr(selPropertyStatus)) = "" Then
|
||||
MsgBox "営業所と物件状況は必ず選択してください", vbExclamation
|
||||
Exit Sub
|
||||
End If
|
||||
|
||||
Loading…
Reference in New Issue
Block a user