Is there any way to hide teh blank rows in excel without using loop ?
-
If the blank rows are within the data, you can apply the auto filter within code to do this. It will leave you with the autofilter selectors on the sheet but it is the quickest method. Just record a macro of you doing the task and you will have the basis for the code.
The FoZ
-
If the blank rows are within the data, you can apply the auto filter within code to do this. It will leave you with the autofilter selectors on the sheet but it is the quickest method. Just record a macro of you doing the task and you will have the basis for the code.
The FoZ
-
i am exporting the data to excel and finally i get the blank row below the data. I want to hide those rows without iteration
If the rows are at the end, you can find the row of the last cell that contains any data. In VBA it looks like this
Dim lastCell As Range
Set lastCell = Range("A1").SpecialCells(xlCellTypeLastCell)From that you can work your way up deleting the blank rows. It still uses iteration but there are fewer.
The FoZ
-
If the rows are at the end, you can find the row of the last cell that contains any data. In VBA it looks like this
Dim lastCell As Range
Set lastCell = Range("A1").SpecialCells(xlCellTypeLastCell)From that you can work your way up deleting the blank rows. It still uses iteration but there are fewer.
The FoZ
-
Are they just the normal blank rows you get in any Excel spreadsheet? Or do they actual contain something and is making your workbook file size huge?
The FoZ
-
normal. Suppose i send 9 rows to excel through datatable class. and the remaining 65000 are blank, i wanted to hide these blank rows
-
If you now where the data ends, you will be able to create a range object that starts from the last row and finishes at the end of the spreadsheet then set the hidden property to true. Something like
rangeToHide.EntireRow.Hidden = true;
The FoZ