ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Delete duplicate headings (https://www.excelbanter.com/excel-programming/337018-delete-duplicate-headings.html)

[email protected]

Delete duplicate headings
 
I am wondering if it is possible to write a macro to delete duplicate
heading in a worksheet. The heading is hard coded in a program that I
am converting to excel so the heading is repeated in the worksheet and
I am currently manually deleting the headings so that I can sort and
manipulate the data and I am just repeating the rows at the top when it
is printed for the heading. Please help!

Thanks!


STEVE BELL

Delete duplicate headings
 
There are dozens of ways to delete rows.

The trick is finding a way to identify each row that you want to delete.

One of the ways is to used code to replace one of the headings with nothing.
But you need to exclude the first row.
Than have code that will select that column, than goto special blanks.
Than delete entire rows.

You can do this manually and have the recorder turned on. This will give
you the code.
But this code will show the exact cell designations. These will most likely
need to be replaced with
variables to work on a changing set of data.

Reply back if this doesn't help, or if you need further help.

Another way is to identify the header, than loop from the last row to row 2.
If the cell is equal to the header, than Rows(x).delete

--
steveB

Remove "AYN" from email to respond
wrote in message
oups.com...
I am wondering if it is possible to write a macro to delete duplicate
heading in a worksheet. The heading is hard coded in a program that I
am converting to excel so the heading is repeated in the worksheet and
I am currently manually deleting the headings so that I can sort and
manipulate the data and I am just repeating the rows at the top when it
is printed for the heading. Please help!

Thanks!





All times are GMT +1. The time now is 04:58 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com