- Trending Categories
- Data Structure
- Operating System
- MS Excel
- C Programming
- Social Studies
- Fashion Studies
- Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
How to Only Delete Visible Rows or Columns in Excel?
Although deleting rows or columns in a spreadsheet can be a common activity, there are occasions when you might want to retain the hidden rows or columns in tact. When working with filtered data or removing specific data from a sizable dataset without altering the hidden information, this can be especially helpful.
We will examine the procedures for successfully completing this work in this tutorial. No of your level of Excel proficiency, you'll find the directions simple to follow and apply to your own projects. You will have a firm grasp on how to erase visible rows or columns in Excel without affecting the hidden data by the end of this course. So let's get started and explore the world of Excel where you'll discover how to just remove the rows or columns that are visible!
Only Delete Visible Rows or Columns
Here, we will first create a VBA module and then run it to complete the task. So let us see a simple process to learn how you can only delete visible rows or columns in Excel.
Consider an Excel sheet where you have hidden rows and column.
First, right-click on the sheet name and select View code to open the VBA application.
Right Click > View Code.
Then click on Insert, select Module, and copy the below code into the text box.
Insert > Module > Copy.
Sub DeleteVisibleRows() Dim WorkRng As Range On Error Resume Next xTitleId = "Delete Visible Cells" Set WorkRng = Application.Selection Set WorkRng = Application.InputBox("Range", xTitleId, WorkRng.Address, Type:=8) Application.ScreenUpdating = False WorkRng.SpecialCells(xlCellTypeVisible).ClearContents Application.ScreenUpdating = True End Sub
Then click F5 to run the module. Then select the range of cells and click OK.
F5 > Select Cells > Ok.
This is how you can only delete visible rows or columns in Excel.
In this tutorial, we have used a simple example to demonstrate how you can only delete visible rows or columns in Excel to highlight a particular set of data.
Kickstart Your Career
Get certified by completing the courseGet Started