メインコンテンツへスキップ

Excelのドロップダウンリストに事前に選択された値を設定/表示するにはどうすればよいですか?

デフォルトでは、作成した一般的なドロップダウンリストは、リストからXNUMXつの値を選択する前に空白で表示されますが、場合によっては、ユーザーがドロップダウンリストから値を選択する前に、ドロップダウンリストに事前に選択した値/デフォルト値を表示または設定することができます。以下のスクリーンショットのリストを示します。 ここでこの記事はあなたを助けることができます。


矢印青い右バブル 式を使用してドロップダウンリストのデフォルト値(事前に選択された値)を設定します

ドロップダウンリストのデフォルト値を設定するには、最初に一般的なドロップダウンリストを作成してから、数式を使用する必要があります。

1.ドロップダウンリストを作成します。 ドロップダウンリストを配置するセルまたは範囲を選択します。これがK1で、クリックします。 且つ > データ検証。 スクリーンショットを参照してください:
doc show preselectedvalueドロップダウンリスト2

2.次に、 データ検証 ダイアログ 設定 タブ、選択 リスト   次を許可します。 リストをクリックし、ドロップダウンリストに表示する値を選択して ソース テキストボックス。 スクリーンショットを参照してください:
doc show preselectedvalueドロップダウンリスト3

3。 次に、をクリックします エラーアラート のタブ データ検証 ダイアログ、およびチェックを外します 無効なデータが入力された後にエラーアラートを表示する オプション。 スクリーンショットを参照してください:
doc show preselectedvalueドロップダウンリスト4

4。 クリック OK ダイアログを閉じ、ドロップダウンリストに移動して、この式を入力します = IF(J1 = ""、 "--select--") それに、を押します 入力します キー。 スクリーンショットを参照してください:
doc show preselectedvalueドロップダウンリスト5

ヒント: 式中、 J1 はK1の隣の空白のセルであり、セルが空白であることを確認し、「- 選択する - "は、表示する事前に選択された値であり、必要に応じて変更できます。

5.次に、ドロップダウンリストセルを選択したままにして、[ 且つ > データ検証 表示する データ検証 もう一度ダイアログを表示し、に移動します エラーアラート タブ、およびチェック 無効なデータが入力された後にエラーアラートを表示する オプションバック。 スクリーンショットを参照してください:
doc show preselectedvalueドロップダウンリスト6

7。 クリック OK、ユーザーがドロップダウンリストから値を選択する前に、ドロップダウンリストのある指定されたセルにデフォルト値が表示されるようになりました。
doc show preselectedvalueドロップダウンリスト7

注: ドロップダウンリストから値を選択している間、デフォルト値は表示されなくなります。
doc show preselectedvalueドロップダウンリスト8


最高のオフィス生産性向上ツール

🤖 Kutools AI アシスタント: 以下に基づいてデータ分析に革命をもたらします。 インテリジェントな実行   |  コードを生成  |  カスタム数式の作成  |  データを分析してグラフを生成する  |  Kutools関数を呼び出す...
人気の機能: 重複を検索、強調表示、または識別する   |  空白行を削除する   |  データを失わずに列またはセルを結合する   |   数式なしのラウンド ...
スーパールックアップ: 複数の基準の VLookup    複数の値の VLookup  |   複数のシートにわたる VLookup   |   ファジールックアップ ....
詳細ドロップダウン リスト: ドロップダウンリストを素早く作成する   |  依存関係のドロップダウン リスト   |  複数選択のドロップダウンリスト ....
列マネージャー: 特定の数の列を追加する  |  列の移動  |  Toggle 非表示列の表示ステータス  |  範囲と列の比較 ...
注目の機能: グリッドフォーカス   |  デザインビュー   |   ビッグフォーミュラバー    ワークブックとシートマネージャー   |  リソースライブラリ (自動テキスト)   |  日付ピッカー   |  ワークシートを組み合わせる   |  セルの暗号化/復号化    リストごとにメールを送信する   |  スーパーフィルター   |   特殊フィルター (太字/斜体/取り消し線をフィルター...) ...
上位 15 のツールセット12 テキスト ツール (テキストを追加, 文字を削除する、...)   |   50+ チャート 種類 (ガントチャート、...)   |   40+ 実用的 (誕生日に基づいて年齢を計算する、...)   |   19 挿入 ツール (QRコードを挿入, パスから画像を挿入、...)   |   12 変換 ツール (数字から言葉へ, 通貨の換算、...)   |   7 マージ&スプリット ツール (高度な結合行, 分割セル、...)   |   ... もっと

Kutools for Excel で Excel スキルを強化し、これまでにない効率を体験してください。 Kutools for Excelは、生産性を向上させ、時間を節約するための300以上の高度な機能を提供します。  最も必要な機能を入手するにはここをクリックしてください...

説明


Officeタブは、タブ付きのインターフェイスをOfficeにもたらし、作​​業をはるかに簡単にします

  • Word、Excel、PowerPointでタブ付きの編集と読み取りを有効にする、パブリッシャー、アクセス、Visioおよびプロジェクト。
  • 新しいウィンドウではなく、同じウィンドウの新しいタブで複数のドキュメントを開いて作成します。
  • 生産性を 50% 向上させ、毎日何百回もマウス クリックを減らすことができます!
Comments (15)
No ratings yet. Be the first to rate!
This comment was minimized by the moderator on the site
Hi,

How to count (D71) conditionally formatted RED color cell (D40:D70)?

Pls guide...

Thanks.
This comment was minimized by the moderator on the site
Hi,

How to make default value (UP) for certain range of column (C40:C70) only in the below code? Add what command?

Private Sub Worksheet_Change(ByVal Target As Range)
‘Updated by ARUN
Dim xObjV As Validation
On Error Resume Next
Set xObjV = Target.Validation
If xObjV.Type = xlValidateList Then
If IsEmpty(Target.Value) Then Target.Value = “UP”
End If
End Sub

Pls guide…

Thanks.
This comment was minimized by the moderator on the site
Try this code
Private Sub Worksheet_Change(ByVal Target As Range)
    'Updated by ExtendOffice
    Dim xObjV As Validation
    On Error Resume Next
    Set xObjV = Target.Validation
    
    'Check if the target is within C40:C70
    If Not Intersect(Target, Range("C40:C70")) Is Nothing Then
        If xObjV.Type = xlValidateList Then
            If IsEmpty(Target.Value) Then Target.Value = "UP"
        End If
    End If
End Sub
This comment was minimized by the moderator on the site
Hi,

Its working...

Thanks
This comment was minimized by the moderator on the site
Hello, How can I get defined value limit in excel dropdown menu, like I want to Enter Apple in product against three name and it should not put 4th entry and give error if i do so, any solution please.
This comment was minimized by the moderator on the site
Sorry, I do not understand your question, could you describe with more details or upload a file to describe it?
This comment was minimized by the moderator on the site
Hello, How can I get defined value limit in excel dropdown menu, like I want to Enter Apple in product against three name and it should not put 4th entry and give error if i do so, any soluition please.
This comment was minimized by the moderator on the site
hello, my data is about names and phone numbers. can make it if two names selected in one cells using data validations, the particular name which their name as selected, their phone numbers will be shown next to it.

help me!
This comment was minimized by the moderator on the site
Hello!

How can I set a data validation list such that if the drop down value in the cell is deleted, the cell will automatically show a default value (i.e. "-Select-")?

For example, I have a worksheet with multiple drop down lists that I want to show a default value of "-Select-" once the sheet is opened. A user will select values from the lists that will impact the result of calculations throughout the entire spreadsheet. A user may accidentally "delete" the cell contents of the lists. If this happens, rather than the cell becoming blank, I want the cell to show a default value of "-Select-". This scenario occurs in multiple random locations throughout the spreadsheet, not just in one localized place.

I was able to find the following VBA code so far, but it only applies the concept over a range, rather than just individual cells that contain drop down lists. The problem with what I have coded so far is that every single blank cell in the range ends up with "-Select-" in it. Some of the lists are in ranges, but some are also scattered throughout the sheet. The problem I'm having with my current code is that every single blank cell in the range ends up with "-Select-" in it. I'm trying to get this to apply over the entire worksheet to ONLY cells that are drop down lists.

Is what I'm trying to accomplish even possible?

Example file can be found here:
https://drive.google.com/file/d/1VoO8VgFs3IJ0ALwqfk0i8gt69UE4vEKW/view?usp=sharing

Example code:

Option Explicit

Private Sub Worksheet_Change(ByVal Target As Range)
Dim cel As Range
' If Target.Cells.Count > 1 Then Exit Sub 'turning this off allows multiple cells to be selected and deleted at the same time
If Not Intersect(Target, Range("f2:p17")) Is Nothing Then
For Each cel In Range("f2:p17")
Application.EnableEvents = False
If IsEmpty(cel.Value) Then cel.Value = "-Select-"
Next cel
End If
Application.EnableEvents = True
End Sub


Thanks in advance!
This comment was minimized by the moderator on the site
How can I set a data validation list such that if the drop down value in the cell is deleted, the cell will automatically show the a default value (i.e. "-Select-")?

For example, I have a worksheet with multiple drop down lists that I want to show a default value of "-Select-" once the sheet is opened. A user will select values from the lists that will impact the result of calculations throughout the entire spreadsheet. A user may accidentally "delete" the cell contents. If this happens, rather than the cell becoming blank, I want the cell to show a default value of "-Select-". This scenario occurs in multiple random locations throughout the spreadsheet, not just in one localized place.

I was able to come up with the following VBA code so far, but I've only figured out how to apply the concept over a range, rather than just cells that contain a drop down list. The problem with what I have coded so far is that every single blank cell in the range ends up with "-Select-" in it.

Option Explicit

Private Sub Worksheet_Change(ByVal Target As Range)
Dim cel As Range
' If Target.Cells.Count > 1 Then Exit Sub
If Not Intersect(Target, Range("f2:p17")) Is Nothing Then
For Each cel In Range("f2:p17")
Application.EnableEvents = False
If IsEmpty(cel.Value) Then cel.Value = "-Select-"
Next cel
End If
Application.EnableEvents = True
End Sub
This comment was minimized by the moderator on the site
The idea is nice, but my problem is that if the dropdown value is deleted, it doesn't revert to the default.
This comment was minimized by the moderator on the site
I also have the same issue , please reply if you solved it
This comment was minimized by the moderator on the site
Exactly!!! I'm having the same issue, have you found a solution?
This comment was minimized by the moderator on the site
You can insert the function in that specific cell using VBA, make sure you call the insert function when workbook is opening.
This comment was minimized by the moderator on the site
Only works if you speak VBA, not all of us code.
There are no comments posted here yet
Please leave your comments in English
Posting as Guest
×
Rate this post:
0   Characters
Suggested Locations