Removing blank rows based on cell value

Jedi Master

Board Regular
Joined
Jun 10, 2024
Messages
70
Office Version
  1. 365
Platform
  1. Windows
1722346833519.png


Formula in Cell B20: =LET(X,VSTACK('Quote Task Worksheet '!M3,'Quote Task Worksheet (2)'!M3,'Quote Task Worksheet (3)'!M3,'Quote Task Worksheet (4)'!M3,'Quote Task Worksheet (5)'!M3,'Quote Task Worksheet (6)'!M3,'Quote Task Worksheet (7)'!M3,'Quote Task Worksheet (8)'!M3,'Quote Task Worksheet (9)'!M3,'Quote Task Worksheet (10)'!M3,'Quote Task Worksheet (11)'!M3,'Quote Task Worksheet (12)'!M3,'Quote Task Worksheet (13)'!M3,'Quote Task Worksheet (14)'!M3,'Quote Task Worksheet (15)'!M3,'Quote Task Worksheet (16)'!M3,'Quote Task Worksheet (17)'!M3,'Quote Task Worksheet (18)'!M3,'Quote Task Worksheet (19)'!M3,'Quote Task Worksheet (20)'!M3,'Quote Task Worksheet (21)'!M3,'Quote Task Worksheet (22)'!M3,'Quote Task Worksheet (23)'!M3,'Quote Task Worksheet (24)'!M3,'Quote Task Worksheet (25)'!M3,'Quote Task Worksheet (26)'!M3,'Quote Task Worksheet (27)'!M3,'Quote Task Worksheet (28)'!M3,'Quote Task Worksheet (29)'!M3,'Quote Task Worksheet (30)'!M3,'Quote Task Worksheet (31)'!M3,'Quote Task Worksheet (32)'!M3,'Quote Task Worksheet (33)'!M3,'Quote Task Worksheet (34)'!M3,'Quote Task Worksheet (35)'!M3,'Quote Task Worksheet (36)'!M3,'Quote Task Worksheet (37)'!M3,'Quote Task Worksheet (38)'!M3,'Quote Task Worksheet (39)'!M3,'Quote Task Worksheet (40)'!M3,'Quote Task Worksheet (41)'!M3,'Quote Task Worksheet (42)'!M3,'Quote Task Worksheet (43)'!M3,'Quote Task Worksheet (44)'!M3,'Quote Task Worksheet (45)'!M3,'Quote Task Worksheet (46)'!M3,'Quote Task Worksheet (47)'!M3,'Quote Task Worksheet (48)'!M3,'Quote Task Worksheet (49)'!M3,'Quote Task Worksheet (50)'!M3),IFERROR(UNIQUE(FILTER(X,INDEX(X,,1)<>"")),""))

There are similar formulas in cells C,D,E20. Since I am looking at 50 worksheets, I potentially need 50 spaces starting in row 20. What is the best way to remove the unused or blank rows automatically. Can this be done with a formula based on cell value in column B if it is not empty?
 

Excel Facts

Save Often
If you start asking yourself if now is a good time to save your Excel workbook, the answer is Yes
** I have solved this problem using the following Macro**

Sub HideRowsIfColumnBIsBlank()
Dim ws As Worksheet
Dim rng As Range
Dim cell As Range


Set ws = ThisWorkbook.Sheets("PROPOSAL High Level")


Set rng = ws.Range("B21:B70")


If IsEmpty(cell.Value) Then
cell.EntireRow.Hidden = True
Else
cell.EntireRow.Hidden = False
End If
Next cell
End Sub
 
Upvote 0
** I have solved this problem using the following Macro**
That macro is incomplete. If you would like to post the complete macro** then it is fine to mark your post as the solution.

** When posting vba code in the forum, please use the available code tags. It makes your code much easier to read/debug & copy. My signature block below has more details.
 
Upvote 0

Forum statistics

Threads
1,221,310
Messages
6,159,176
Members
451,543
Latest member
cesymcox

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top