General discussion on MS Excel and its spreadsheets.
Hi, I have written a macro that combines sheet1 of all workbooks within a folder into one worksheet. I now need to figure out how to delete all of the headers (there are all the same), except for the 1st one, as well as all of the rows where column D is blank. Any suggestions? Thank you.
Joseph S. Klein
- Posts: 38
- Joined: Mon Mar 24, 2014 6:28 am
the number of workbooks that will be combined will change each time the user has to use it, so I would not be able to delete headers by counting them. Since all of the headers are exactly the same, I was hoping to have a code that would look for all of the rows that are equal to the first one and delete all of them, excluding the first one.
- Posts: 28
- Joined: Tue Mar 25, 2014 6:27 am
I did wind up using a different code since the value in column A would be the same in all of the headers. I just used:
Sub Delete Repeated Header()
Dim LR As Long, i As Long
LR = Range("A" & Rows.Count).End(xlUp).Row
For i = LR To 2 Step -1
If Range("A" & i).Value = "PLANID" Then Rows(i).Delete
- Posts: 20
- Joined: Tue Mar 25, 2014 6:29 am
Return to MS Excel- Help Forum
Who is online
Users browsing this forum: No registered users and 0 guests