Hide a Cell Border with Conditional Formatting in Excel
Question details
Show or hide a cell border based on the option selected in a drop-down list.

- Product
- Microsoft Excel
- Device & OS
- not provided
- Scenario
- A worksheet uses a drop-down list to control whether an input cell looks like a bordered text box.
- Observed behavior
- The cell border should be hidden when the specified drop-down option is selected and visible for other selections.
Identify the drop-down cell, the exact option text, and the cell whose border you want to control. The example below uses D2 and the option Product Range.
Apply the border only when the drop-down option does not match
Use a formula-based rule to show a border for other selections and leave it hidden when Product Range is selected.
Conditional formatting works reliably here when the normal cell format has no border and the rule adds the border when needed. Selecting None in a conditional format may not remove an existing normal border.
Select the input cell, then choose Home > Borders > No Border.
With the cell selected, choose Home > Conditional Formatting > New Rule > Use a formula to determine which cells to format.
Enter =$D$2<>"Product Range" in the formula box. Replace D2 and Product Range with your drop-down cell and exact option text.
Select Format, open the Border tab, choose a line style and the border edges you want, then select OK to save the format and rule.
Select Product Range in D2 and confirm the border disappears. Select another option to confirm the border appears.

Control a cell border with a drop-down in WPS Spreadsheet
Use a formula-based conditional formatting rule in WPS Spreadsheet to display a cell border only when the selected drop-down option calls for it.
- 1. Open the workbook: Open the workbook in WPS Spreadsheet and identify the drop-down cell and the cell whose border you want to control.
- 2. Clear the normal border: Select the target cell and choose Home > Borders > No Border.
- 3. Add the rule: Choose Home > Conditional Formatting > New Rule, select the formula-based rule option, and enter =$D$2<>"Product Range", adjusting the cell reference and option text as needed.
- 4. Format and test: Set the desired border in the rule's formatting options, save the rule, and change the drop-down selection to check that the border appears and disappears.

Frequently Asked Questions
Why does selecting No Border in the conditional format not hide my existing border?
A conditional format with no border may leave the cell's normal border unchanged. Remove the normal border using Home > Borders > No Border, then use a conditional rule to add the border when it should be visible.
How do I show the border only when Product Range is selected?
Create a formula-based conditional formatting rule using =$D$2="Product Range", then set the desired border in the rule's Format > Border settings.
Why can I still see lines around the cell?
The lines may be worksheet gridlines rather than cell borders. In Excel, clear View > Gridlines to hide gridlines across the worksheet.
Can this rule hide an actual text box shape?
No. Conditional formatting changes cell formatting, not separate text box shapes. Use a bordered cell as the input area if you want the border to respond to a formula-based rule.




