How to remove or hide borders from group boxes in Excel?
When working in Excel, especially for tasks such as creating questionnaires or surveys, you might use group boxes to organize multiple option buttons. Group boxes help visually separate different sets of choices, making the worksheet more interactive and user-friendly. However, the default border lines around these group boxes can sometimes appear uneven or clash with the neat gridlines of Excel cells, resulting in a cluttered look as shown below:

For users seeking a cleaner presentation, there are practical methods available to remove or hide those distracting group box borders. This not only enhances the visual appeal of your worksheet but can also make it more professional and easier to interpret, especially when sharing with others or preparing printed versions.
Remove or hide borders from group boxes with one code
Remove or hide borders from group boxes with VBA code
Remove or hide borders from group boxes with one code
A quick and efficient way to hide the borders of all group boxes on the active worksheet is to use the Immediate window in VBA. This method is ideal if you need to update several group boxes at once without manually editing each object's properties. It also keeps your worksheet’s underlying structure intact for later editing.
1. Press ALT + F11 to open the Microsoft Visual Basic for Applications window. Ensure your active worksheet is the one containing the group boxes you want to affect.
2. Open the Immediate window by pressing Ctrl + G. This panel allows you to enter and execute simple commands instantly.
Type the following code into the Immediate window: activesheet.groupboxes.visible = false

3. Press Enter to execute. Instantly, all group box borders on the current worksheet will be hidden. The group boxes themselves still exist, so option buttons or controls within them remain interactive and usable.
This method is especially advantageous when you want a reversible change. If you later wish to redisplay the borders, simply go back to the Immediate window and enter: activesheet.groupboxes.visible = true, then press Enter. All borders will reappear as before.
Troubleshooting tips: If nothing happens when you run the Immediate window command, double-check that your group boxes are native Excel form controls, not ActiveX controls (which use different properties). Also, make sure you are affecting the correct worksheet by checking which is active in your Excel window.
Remove or hide borders from group boxes with VBA code
For users comfortable with VBA, you can use a simple macro to loop through and hide borders for all group boxes in your active worksheet. This approach provides a bit more flexibility and can be modified to suit other requirements in the future.
1. Press ALT + F11 to open the Visual Basic for Applications editor.
In the VBA editor, click Insert > Module to create a new code module. Then copy and paste the following code into the module window:
VBA code: Remove or hide borders from group boxes:
Sub ToggleVisible()
Dim myGB As GroupBox
For Each myGB In ActiveSheet.GroupBoxes
myGB.Visible = False
Next myGB
End Sub
3. Press F5 or click the "Run" button in the VBA editor to execute the code. Instantly, all borders of group boxes in the active worksheet are hidden, regardless of how many you have. Please refer to the screenshot for the expected result:

This VBA approach allows you to re-use the macro for other worksheets or easily modify it to only affect certain group boxes if needed by adding conditional logic.
Cautions: Make sure to save your workbook before running any VBA code, as undo is not available for macro actions. If you are working in a locked or protected worksheet, you may require additional code to unlock it prior to running this script.
In summary, hiding or removing borders from group boxes in Excel can greatly improve worksheet readability and aesthetics. Choose a solution based on your experience level and the scale of your project—VBA and Immediate window codes are quick for large batches, while manual formatting offers flexibility for individual adjustments. Always save your work beforehand, and double-check your target objects to ensure proper effect. If borders persist, revisit the steps and verify you’re using the right type of control and formatting settings.
Best Office Productivity Tools
Supercharge Your Excel Skills with Kutools for Excel, and Experience Efficiency Like Never Before. Kutools for Excel Offers Over 300 Advanced Features to Boost Productivity and Save Time. Click Here to Get The Feature You Need The Most...
Office Tab Brings Tabbed interface to Office, and Make Your Work Much Easier
- Enable tabbed editing and reading in Word, Excel, PowerPoint, Publisher, Access, Visio and Project.
- Open and create multiple documents in new tabs of the same window, rather than in new windows.
- Increases your productivity by 50%, and reduces hundreds of mouse clicks for you every day!
All Kutools add-ins. One installer
Kutools for Office suite bundles add-ins for Excel, Word, Outlook & PowerPoint plus Office Tab Pro, which is ideal for teams working across Office apps.
- All-in-one suite — Excel, Word, Outlook & PowerPoint add-ins + Office Tab Pro
- One installer, one license — set up in minutes (MSI-ready)
- Works better together — streamlined productivity across Office apps
- 30-day full-featured trial — no registration, no credit card
- Best value — save vs buying individual add-in