The value of a cell in row 1 probably doesn't conform to the rules for naming ranges. See What Are the Rules for Excel Names?
Use first row as column name
Hi,
I want to use first row as column name in Excel. Then I want to select and keep the specific named columns using macro.
I found the code for the first step in naming the column: VBA Name Columns based on names in first row - Microsoft Community. When I tried to run it, I got this problem:
I am new to VBA. I don't understand why this part doesn't work. Any help would be appreciated.
Thanks in advance.
Microsoft 365 and Office | Excel | For home | Windows
Locked Question. This question was migrated from the Microsoft Support Community. You can vote on whether it's helpful, but you can't add comments or replies or follow the question.