HeadAgainstABrickWall
New Member
- Joined
- Jan 30, 2022
- Messages
- 30
- Office Version
- 365
- Platform
- Windows
Hi all, crossposted on Stack overflow:
I'm doing some data cleaning and am trying to reduce the load before I fully automated the process through macros. Currently using the following to add alternating rows:
Sub AddColumns
For colx= [X] to [Y] Step 2
Columns(colx).Insert Shift:=xlToRight
Next
EndSub
What I want to add in is changing the colour of these new columns as they are added, and also automatically renaming them based on the column header before - e.g. the column added after "Type" would be "Check Type", the column added after "Name" would be "Check Name".
I'm struggling to even figure out how to start - I'm guessing that it would be on a per-column basis to colour the column named Column 1, and then to change header name to "Check"&value of c-1?
All suggestions welcome!
I'm doing some data cleaning and am trying to reduce the load before I fully automated the process through macros. Currently using the following to add alternating rows:
Sub AddColumns
For colx= [X] to [Y] Step 2
Columns(colx).Insert Shift:=xlToRight
Next
EndSub
What I want to add in is changing the colour of these new columns as they are added, and also automatically renaming them based on the column header before - e.g. the column added after "Type" would be "Check Type", the column added after "Name" would be "Check Name".
I'm struggling to even figure out how to start - I'm guessing that it would be on a per-column basis to colour the column named Column 1, and then to change header name to "Check"&value of c-1?
All suggestions welcome!