問題を解決できました。
私はVBAコードをオンラインで見つけ、必要に応じて改造しました。
Option Explicit
Private Sub Worksheet_Change(ByVal Target As Range)
' Ensure all lists are made from tables and that these tables are named
' in the Name Manager.
' When creating your Data Validation List, instead of selecting a range
' in 'Source', click within 'Source' and press 'F3'. Finally select your
' tables name.
Dim strValidationList As String
Dim strVal As String
Dim lngNum As Long
On Error GoTo Nevermind
strValidationList = Mid(Target.Validation.Formula1, 2)
strVal = Target.Value
lngNum = Application.WorksheetFunction.Match(strVal, ThisWorkbook.Names(strValidationList).RefersToRange, 0)
' Converts table contents into a formula
If strVal <> "" And lngNum > 0 Then
Application.EnableEvents = False
Target.Formula = "=INDEX(" & strValidationList & ", " & lngNum & ")"
End If
Nevermind:
Application.EnableEvents = True
End Sub
データ検証リストはどのように定義されていますか?ここでは手伝いが難しいとは思っていません。 –
データ検証のソース範囲を編集しましたか? – dwirony
データ検証設定のイメージとリストを生成する式を追加しました。 –