Deleting blank rows and have formulas but have no value

josros60

Well-known Member
Joined
Jun 27, 2010
Messages
780
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
 
Hi,

tried your sample wont' work since column H is no blank have formulas but no value, see sample of sheet:

NCL_AP STATEMENT1
A
16
STATEMENT
 
Upvote 0

Excel Facts

Best way to learn Power Query?
Read M is for (Data) Monkey book by Ken Puls and Miguel Escobar. It is the complete guide to Power Query.
NCL_AP STATEMENT1.xlsx
ABCDEFGHI
15INVOICE DATEINVOICE #INVOICE DUE DATEA/CAMOUNT$ INVOICE/PAYMENT/ ADJUSTMENTREF/ CHQ. #BALANCEREMARKS
16Balance brought forward
1712/17/2020CA100010049801/16/2021339.00339.00
1812/17/2020CA100010049901/16/2021840.151,179.15
1912/17/2020CA100010050001/16/20217,775.158,954.30
2001/14/2021PY00000000000000004546(8,954.30)0.00
21
22
23
24
25
26
27
28
29
30
31
STATEMENT
Cell Formulas
RangeFormula
H17:H20H17=IF(AND(ISBLANK(E17)),"",H16+E17)
 
Upvote 0
Sample here:

NCL_AP STATEMENT1.xlsx
ABCDEFGHI
15INVOICE DATEINVOICE #INVOICE DUE DATEA/CAMOUNT$ INVOICE/PAYMENT/ ADJUSTMENTREF/ CHQ. #BALANCEREMARKS
16Balance brought forward
1712/17/2020CA100010049801/16/2021339.00339.00
1812/17/2020CA100010049901/16/2021840.151,179.15
1912/17/2020CA100010050001/16/20217,775.158,954.30
2001/14/2021PY00000000000000004546(8,954.30)0.00
21
22
23
24
25
26
27
28
29
30
31
STATEMENT
Cell Formulas
RangeFormula
H17:H20H17=IF(AND(ISBLANK(E17)),"",H16+E17)
 
Upvote 0
:confused: There are no rows in that sample that I can see that meet the requirement you originally stated:



What row(s) do you want deleted from that sample and why?
Confused me too :unsure:
 
Upvote 0
The ones following the rows with data.

For example my statement have 60 rows range A17:h60 if I used 20 rows want the macros to delete rest the blanks rows in this case 40 rows but when macro runs udsint counta won't delete because on column H have formulas but no value.
 
Upvote 0
If I understand your setup correctly, this single line of code should delete the rows you want to delete...
VBA Code:
Range(Cells(Rows.Count, "A").End(xlUp).Offset(1), Cells(Rows.Count, "H").End(xlUp)).EntireRow.Delete
 
Upvote 0
If I understand your setup correctly, this single line of code should delete the rows you want to delete...
VBA Code:
Range(Cells(Rows.Count, "A").End(xlUp).Offset(1), Cells(Rows.Count, "H").End(xlUp)).EntireRow.Delete
Perhaps you missed post #10? ;)

@josros60
Are you sure that you tried the post #10 code?
If you have and it did not do what you want, can you post another mini-sheet that includes some extra rows like you are describing in words but so far not including in your mini-sheet?
 
Upvote 0
any help?

want delete blank rows for A17:I80, let say I used rows A17 to I30 want to delete the rest blank rows even though in column H there are formulas but have no values from A30 to I80.

thanks.
 
Upvote 0

Forum statistics

Threads
1,214,918
Messages
6,122,241
Members
449,075
Latest member
staticfluids

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