Deleting cells

sergemaster

New Member
Joined
Feb 18, 2011
Messages
5
Greetings all,
I am attempting to delete the contents of every third cell in column E going in a decending order. There are several thousand lines of data so I am looking for a formula that can automate this process, can anyone help?

Cheers,
Serge
 

Excel Facts

What is the last column in Excel?
Excel columns run from A to Z, AA to AZ, AAA to XFD. The last column is XFD.
Welcome to the Board!

You could put this formula in an empty column and then filter for true and then delete. It should put true in every 3rd cell:

=mod(row(a1),3)=0

Or you could use vba code to do this.

Hope that helps.
 
Upvote 0
To clarify, you are starting on row 1, and you want to clear the contents of E1, E4, E7, E10, etc?
 
Upvote 0
Sample Spreadsheet BEFORE Running Macro Below:
Excel Workbook
ABCDE
1My Stuff
21
32
43
54
65
76
87
98
109
1110
1211
1312
1413
1514
1615
1716
1817
1918
2019
2120
2221
2322
2423
2524
2625
2726
2827
2928
Sheet1
Excel 2007

Code:
Sub Foo()
For i = 3 To 30 Step 3
Cells(i + 1, 5).ClearContents
Next i
End Sub

Spreadsheet After running Macro Foo():
Excel Workbook
ABCDE
1My Stuff
21
32
4
54
65
7
87
98
10
1110
1211
13
1413
1514
16
1716
1817
19
2019
2120
22
2322
2423
25
2625
2726
28
2928
Sheet1
Excel 2007
 
Upvote 0
Hey guys, thanks for the QUICK responses!

I am starting on cell E3 and need to delete in decending order to E28206. I hope this helps..

Cheers,
Serge
 
Upvote 0
I am starting on cell E3 and need to delete in decending order to E28206. I hope this helps..
So Try...

Code:
Sub Foo()
For i = 3 To 28206 Step 3
Cells(i, 5).ClearContents
Next i
End Sub
 
Upvote 0
Give this a go:

Code:
Public Sub DeleteThirdRow()
Dim i   As Long, _
    LR  As Long
    
LR = Range("E" & Rows.Count).End(xlUp).row
Application.ScreenUpdating = False
For i = 3 To LR Step 3
    Range("E" & i).ClearContents
Next i
Application.ScreenUpdating = True
End Sub
 
Upvote 0
Thanks everyone for responding. Please forgive my inexperience with Excel, but where can I copy and paste one of these formulas into so I can give them a whirl and see if it works.

Cheers,
Serge
 
Upvote 0
Thanks everyone for responding. Please forgive my inexperience with Excel, but where can I copy and paste one of these formulas into so I can give them a whirl and see if it works.

Cheers,
Serge

For the code supplied by JimMay or myself, press Alt+F11 to bring up the VBA Editor. In here, go to Insert>Module. Then copy and paste either of our code into the window on the right side. Go back to your spreadsheet and press Alt+F8 to bring up the Macros window. Choose the name of the macro from the list and press "Run".
 
Upvote 0
Hey guys,
Not only did it work like a charm, but I learned something also! Although I have another question that I will post in a seperate thread, I want to thank all of the Excel Gurus that helped me with this one!

Cheers,
Serge
 
Upvote 0

Forum statistics

Threads
1,224,587
Messages
6,179,738
Members
452,940
Latest member
Lawrenceiow

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