how delete cells occur

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

Forum home » Delegate support and help forum » Microsoft Excel Training and help » How to delete cells that occur every 3rd cell | Excel forum

How to delete cells that occur every 3rd cell | Excel forum

resolvedResolved · Medium Priority · Version 2003

Suyeon has attended:
Excel Advanced course
Excel VBA Intro Intermediate course
Access Advanced course

How to delete cells that occur every 3rd cell

how do I programme vba so that I can delete every 3rd cell ( populated) going down?

Many thanks

RE: how to delete cells that occur every 3rd cell

Hi again Suyeon

This time place the cursor in the top cell first.
Then using a Do loop every third cell down is deleted until a black cell is reached.

Sub DeleteEveryThird()
'Place cursor in top cell first

Do Until ActiveCell.Value = ""
ActiveCell.Offset(2, 0).Select
ActiveCell.Delete Shift:=xlUp
Loop

End Sub

Regards
Doug
Best STL

Wed 25 Jul 2012: Automatically marked as resolved.


 

Excel tip:

Random Numbers

Type =RAND()*200 to generate a number between 1 and 200.
Use the fill handle to drag down and populate as many cells as you'd like with random numbers.

View all Excel hints and tips


Server loaded in 0.08 secs.