• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

How to use VBA to delete every other row on spreadsheet?

Eloise T

Active Member
I have a spreadsheet that has 1000 rows of data, but every other row is blank (see sample attachment). I'm looking to delete the blank rows (every other row, which happen to be the odd numbered rows) starting with A1. Also, I need to move some of the data (first occurrence of a blank character in a row with data) from Column A to Column B. Thank you in advance.

Update: I just found out how to delete all the blank rows by:
1) highlighting Column A,
2) then pressing F5,
3) then [Special...] button,
4) select radio button [Blanks],
5) then [OK],
6) then go to the Cells ribbon,
7) then click [Delete],
8) and finally [Delete Sheet Rows].

So, all I need is to separate and move the data from only Column A to both Column A and B.
 

Attachments

  • Chandoo - Macro to remove every other row and divide data into columns A and B.xlsx
    9.3 KB · Views: 7
Last edited:
Just attach the raw data workbook as it is really, it can avoid you to amend a code given by any helper …​
Or as usual just operate a replacement of the character #160 with space then convert the column on space (Text to Columns) …​
 
Just so I understand, replace ASCII 32 with ASCII 160 then use (Text to Columns) function, correct? This will separate the data from just Column A to Columns A and B?
 
No, replace character #160 by space then you can give a try to the Text To Columns Excel feature with space as delimiter …​
 
Back
Top