Deleting blank rows and have formulas but have no value

josros60

Well-known Member
Joined
Jun 27, 2010
Messages
781
Office Version
  1. 365
How can delete blank rows from a range that contains formulas but have no value using VBA, any sample please.

Thank you
 

Excel Facts

Copy a format multiple times
Select a formatted range. Double-click the Format Painter (left side of Home tab). You can paste formatting multiple times. Esc to stop
Is it something similar to this?
 
Upvote 0
How big (number of rows) is your data?

Can you also clarify by referring to the sample below and assuming all cells contain formulas
  • Are we only looking a a particular column, so if it was column C only rows 7 & 8 would be deleted, or
  • Are we looking at all columns, so rows 3, 4, 6, 7 & 8 would get deleted, or
  • By "blank rows" do you mean that only row 8 would be deleted, or
  • Something else?
josros60.xlsm
ABCD
1Hdr1Hdr2Hdr3Hdr4
2xxxx
3xxx
4xxx
5xxxx
6xxx
7xxx
8
9xxxx
Sheet1
 
Upvote 0
It's a statement of has 80 rows but sometimes use only 20 rows need delete the rest but one column have formulas .

Thank you
 
Upvote 0
Sorry, missed it.
Yes, from you sample only row 8 even if there's a formula but no value. (my table has 8 columns with A:H, and H column has carry forward balance formula)
 
Upvote 0
delete blank rows from a range

my table has
Now I'm a little confused as to whether your data is in a formal Excel table (ListObject) or just a normal range that you are referring to as a "table".
Assuming a normal range & that column A can be used to determine the bottom of the 'real' data, try this.

Test with a copy of your workbook.

VBA Code:
Sub Del_Rows()
  Range(Range("A" & Rows.Count).End(xlUp).Offset(1), Range("H" & Rows.Count).End(xlUp)).EntireRow.Delete
End Sub
 
Upvote 0

Forum statistics

Threads
1,215,220
Messages
6,123,698
Members
449,117
Latest member
Aaagu

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