dougmarkham
Active Member
- Joined
- Jul 19, 2016
- Messages
- 252
- Office Version
- 365
- Platform
- Windows
Hi Folks,
I am processing data in a large table that contains some duplicate column header names e.g., there are 2 headers called "Country", two instances of "Customer" and "Product" etc, etc. I cannot find any instance of this on Google search.
Would you please help with the VBA code?
What it needs to do is search 'row 1' for duplicate header names and rename the second, third, fourth etc occurrences by adding a number representing the occurrence number.
E.g., if Country occurred 3 times in A1, Z1, and AZ1, the VBA would locate the duplicate names and rename the repeats thus...
A1 = Country
Z1 = Country1
AZ1 = Country2
Kind regards,
Doug.
I am processing data in a large table that contains some duplicate column header names e.g., there are 2 headers called "Country", two instances of "Customer" and "Product" etc, etc. I cannot find any instance of this on Google search.
Would you please help with the VBA code?
What it needs to do is search 'row 1' for duplicate header names and rename the second, third, fourth etc occurrences by adding a number representing the occurrence number.
E.g., if Country occurred 3 times in A1, Z1, and AZ1, the VBA would locate the duplicate names and rename the repeats thus...
A1 = Country
Z1 = Country1
AZ1 = Country2
Kind regards,
Doug.