Brothersoft.comWindows|Mac|Mobile|Games

|Message

Solve software problem quickly Share experience to help others Improve the ability of solving problem
How to Delete Every Other Row Automatically in Excel 2003

11/15/2011 01:07 by JohnEverard

First answer posted by Artemaria at 11/15/2011 01:07
Add Your Answer
10~1000 characters in length CAPTCHA:
2 Answers
  • Artemaria
    1. Open a new workbook in Excel and type the number "1" in cell A1. Skip cell A2 and type "2" in cell A3. Repeat this process until you have the numbers 1 through 5 entered in cells A1 through A9. The following cells should have the following numbers: "1" for A1, "2" for A3, "3" for A5, "4" for A7 and "5" for A9.

    2. Click "Tools" and select "Macro." Click on "Visual Basic Editor."

    3. Select the "Insert" tab and click "Module."

    4. Copy the following macro and paste it in the Visual Basic sheet:

      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

    5. Click "Close and Return to Microsoft Excel" to exit, then test the macro by highlighting rows A1 through A9 on the Excel spreadsheet you made earlier. Click "Tools," then "Macro" and then click "Macros."

    6. Select "Delete_Every_Other_Row" from the Macro menu and click "Run." The alternate rows will be deleted and numbers 1 through 5 will now be displayed in cells A1 through A5.

  • Was this answer helpful? 00 · 11/15/2011 01:07
  • Anonymous user
  • Thansk alot! This was very usefull.
  • Was this answer helpful? 00 · 01/20/2012 04:04
Add Your Answer
10~1000 characters in length CAPTCHA:
Related Questions
Q:What Is Excel 2003 Training?

A:Microsoft Website The Microsoft Office website offers a wealth of free training on all Microsoft Office products, including Excel 2003. The s...(more)

Q:How to Make a Spreadsheet in Excel 2003

A: Launch Excel 2003 and open a blank document. Click the "File" menu and select the "New" option, which opens a task pane to the right of the ...(more)

Q:How to Convert Quicken to Excel 2003

A: Open the "Report" menu from the top of the Quicken window. Select "Reports and Graph Center." Choose the information that you want to expo...(more)

Q:How to Sort Information by Date in Excel 2003

A: Open Excel 2003 by double-clicking the icon. Click "File," then "Open" and select the spreadsheet you want to work with. Click on the top ...(more)

Q:Troubleshooting Excel 2007 With Slow Response to Scanning Directories

A: Click the "Start" button, and then click "Control Panel." Click the "View by" drop-down menu in the top right corner of the window, and se...(more)

0 people are following

Ask a question now
Write a title for your question

Microsoft Excel Viewer 2003

open, view, and print Excel workbooks, even if you have example excel formula.
Latest version:1.0
License:Freeware
OS:Windows 2003,Windows XP,Windows 2000
Total downloads:445,228
Rank:1 in Spreadsheets
Download It

Share with friends

New features is coming

  • 1. Providing high-quality answers to be a verified Q&A expert
  • 2. Ask and answer questions to get Brothersoft credits

Added Successfully!

×

Are you sure to delete your answer?

NoYes

×

Are you sure to choose it as the best answer?

NoYes

×

Voted Successfully!

×

You can't vote for yourself

×

You can't choose your own answer

×