Browsing articles from "July, 2009"
How to delete every other row in excel
If you want to delete every other row in Excel, you’ll need to use the following macro.
- On the Tools menu, point to Macro, and then click Visual Basic Editor.
- For Excel 2007, click Visual Basic in the Code group on the Developer tab.
- On the Insert menu, click Module.
- Then copy paste the following code :
Sub Delete_Every_Other_Row() ' Dimension variables. Y = False ' Change this to True if you want to ' delete rows 1, 3, 5, and so on. I = 1 Set xRng = Selection ' Loop once for every row in the selection. For xCounter = 1 To xRng.Rows.Count ' If Y is True, then... If Y = True Then ' ...delete an entire row of cells. xRng.Cells(I).EntireRow.Delete ' Otherwise... Else ' ...increment I by one so we can cycle through range. I = I + 1 End If ' If Y is True, make it False; if Y is False, make it True. Y = Not Y Next xCounter End Sub
- Switch to the worksheet that contains the data, and then select the cell that you want to delete.
- To run the macro, point to Macro on the Tools menu, and then click Macros. (For Excel 2007, click Macros in the Code group on the Developer tab.)
- Select the Delete_Every_Other_Row macro, and then click Run.
Hopefully, future Excel versions will have built-in functions to delete every other row.
Source : Microsoft KB
Loading
Recent Posts
Recent Comments
Tags
Alexa
Apple
BtN related
CSS
debian
domain names
Easter Eggs
Firefox
gadgets
gmail
Google
greetings
IE
IM
Innovative
Internet
ipod
Linux
linux commands
Mac
Microsoft
Misc
My Experience
news
notepad bug
Online Services
Opera
Opinions
Outlook
PC vs Mac
Programs
Registry
SEO
Software
sony
steve jobs
sudoers
Tech News
Tips
Tricks
ubuntu
Windows
windows xp
Win XP
Yahoo
Archives
- December 2011
- November 2011
- October 2011
- September 2011
- August 2011
- November 2009
- July 2009
- May 2009
- April 2009
- January 2009
- October 2008
- September 2008
- August 2008
- February 2008
- January 2008
- December 2007
- November 2007
- October 2007
- September 2007
- August 2007
- July 2007
- June 2007
- November 2006
- February 2006
- January 2006
- December 2005

