Note: The other languages of the website are Google-translated. Back to English
登入  \/ 
x
or
x
註冊  \/ 
x

or

如何在Excel中設置/顯示下拉列表的預選值?

默認情況下,您創建的常規下拉列表在從列表中選擇一個值之前顯示為空白,但是在某些情況下,您可能希望在用戶從下拉列表中選擇一個之前顯示或設置下拉列表的預選值/默認值列表如下所示。 本文可以為您提供幫助。


箭頭藍色右氣泡 使用公式為下拉列表設置默認值(預選值)

要為下拉列表設置默認值,您需要先創建一個常規下拉列表,然後使用公式。

1.創建一個下拉列表。 選擇要放置下拉列表的單元格或範圍,這裡是K1,然後單擊 數據 > 數據驗證。 看截圖:
doc顯示預選值下拉列表2

2.然後在 數據驗證 對話框下 設置 標籤,選擇 名單 低至 列表,然後在下拉列表中選擇要顯示的值 資源 文本框。 看截圖:
doc顯示預選值下拉列表3

3。 然後點擊 錯誤警報 在標籤 數據驗證 對話框,然後取消選中 輸入無效數據後顯示錯誤警報 選項。 看截圖:
doc顯示預選值下拉列表4

4。 點擊 OK 關閉對話框,然後轉到下拉列表,然後鍵入此公式 = IF(J1 =“”,“ --select--”) 進去,然後按 Enter 鍵。 看截圖:
doc顯示預選值下拉列表5

類型: 在公式, J1 是K1旁邊的空白單元格,請確保該單元格為空白,然後“- 選擇 - ”是您要顯示的預選值,您可以根據需要進行更改。

5.然後,保持下拉列表單元處於選中狀態,然後單擊 數據 > 數據驗證 顯示 數據驗證 再次對話,然後轉到 錯誤警報 標籤,並檢查 輸入無效數據後顯示錯誤警報 選項回來。 看截圖:
doc顯示預選值下拉列表6

7。 點擊 OK,現在用戶在從下拉列表中選擇值之前,在帶有下拉列表的指定單元格中顯示了一個默認值。
doc顯示預選值下拉列表7

備註: 從下拉列表中選擇一個值時,默認值消失。
doc顯示預選值下拉列表8



最佳辦公效率工具

Kutools for Excel解決了您的大多數問題,並使您的生產率提高了80%

  • 重用: 快速插入 複雜的公式,圖表 以及您以前使用過的任何東西; 加密單元 帶密碼 創建郵件列表 並發送電子郵件...
  • 超級公式欄 (輕鬆編輯多行文本和公式); 閱讀版式 (輕鬆讀取和編輯大量單元格); 粘貼到過濾範圍...
  • 合併單元格/行/列 不會丟失數據; 拆分單元格內容; 合併重複的行/列...防止細胞重複; 比較範圍...
  • 選擇重複或唯一 行; 選擇空白行 (所有單元格都是空的); 超級查找和模糊查找 在許多工作簿中; 隨機選擇...
  • 確切的副本 多個單元格,無需更改公式參考; 自動創建參考 到多張紙; 插入項目符號,複選框等...
  • 提取文字,添加文本,按位置刪除, 刪除空間; 創建和打印分頁小計; 在單元格內容和註釋之間轉換...
  • 超級濾鏡 (將過濾方案保存並應用於其他工作表); 高級排序 按月/週/日,頻率及更多; 特殊過濾器 用粗體,斜體...
  • 結合工作簿和工作表; 根據關鍵列合併表; 將數據分割成多個工作表; 批量轉換xls,xlsx和PDF...
  • 超過300種強大功能。 支持Office / Excel 2007-2019和365。支持所有語言。 在您的企業或組織中輕鬆部署。 完整功能30天免費試用。 60天退款保證。
kte選項卡201905

Office選項卡為Office帶來了選項卡式界面,使您的工作更加輕鬆

  • 在Word,Excel,PowerPoint中啟用選項卡式編輯和閱讀,發布者,Access,Visio和Project。
  • 在同一窗口的新選項卡中而不是在新窗口中打開並創建多個文檔。
  • 每天將您的工作效率提高50%,並減少數百次鼠標單擊!
officetab底部
Say something here...
symbols left.
You are guest
or post as a guest, but your post won't be published automatically.
Loading comment... The comment will be refreshed after 00:00.
  • To post as a guest, your comment is unpublished.
    miradek · 2 years ago
    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!
  • To post as a guest, your comment is unpublished.
    JStirfry · 2 years ago
    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!
  • To post as a guest, your comment is unpublished.
    Justin · 2 years ago
    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
  • To post as a guest, your comment is unpublished.
    Dary · 4 years ago
    The idea is nice, but my problem is that if the dropdown value is deleted, it doesn't revert to the default.
    • To post as a guest, your comment is unpublished.
      zaid · 3 years ago
      I also have the same issue , please reply if you solved it
    • To post as a guest, your comment is unpublished.
      Scott · 4 years ago
      Exactly!!! I'm having the same issue, have you found a solution?
      • To post as a guest, your comment is unpublished.
        Alex · 3 years ago
        You can insert the function in that specific cell using VBA, make sure you call the insert function when workbook is opening.
        • To post as a guest, your comment is unpublished.
          Elizabeth Taylor · 2 years ago
          Only works if you speak VBA, not all of us code.