Public Schedule Face-to-Face & Online Instructor-Led Training - View dates & book

deleting rows were there

Forum home » Delegate support and help forum » Microsoft Excel VBA Training and help » Deleting Rows were there are formulas that return a nil value

Deleting Rows were there are formulas that return a nil value

ResolvedVersion 2003

Mona has attended:
Excel VBA Intro Intermediate course
Excel VBA Advanced course

Deleting Rows were there are formulas that return a nil value

How do you write a code which deletes rows where the row contains formulas which returns a nil value.

RE: Deleting Rows were there are formulas that return a nil valu

Hi Mona

Thanks for the question.

I am assuming the values you are wanting to check are in known columns. For my simple example I am assuming the formula is in the B column and my data starts in row one and stops when the formulas stop.


Range("B1").Select
Do Until Activecell.Formula=""
If Activecell.Value=vbNullString Then
Activecell.Entirerow.Delete
Else
ActiveCell.Offset(1,0).Select
End If
Loop


Let me know if that helps.

Laura GB

 

Training courses

Training information:

Welcome. Please choose your application (eg. Excel) and then post your question.

Our Microsoft Qualified trainers will then respond within 24 hours (working days).

Frequently Asked Questions
What does 'Resolved' mean?

Any suggestions, questions or comments? Please post in the Improve the forum thread.

Excel tip:

Seeing named ranges as part of the zoom

If you have large areas of named ranges this works better.

If you zoom down to 39% you will see your named range.

View all Excel hints and tips

Connect with us:

0207 987 3777

Call for assistance

Request Callback

We will call you back

Server loaded in 0.11 secs.