Bill_Davenport
New Member
- Joined
- Jul 25, 2017
- Messages
- 13
hey, first time posting here if you require more information let me know. I have a spreadsheet that I want to make a macro to rearrange columns to be in a specific order, it's easy to do if the columns are always in the same spot, i could just record a macro and run it but I want this to be useable for multiple different users and depending on their individual preferences the columns will be in a different order
for example I want columns in order of column A, B, C, D etc
user1 may have columns in order of B, D, A, C and user 2 may have it in C, B, D, A.
luckily the column header names will always be consistant, can someone point me to a macro that will rerrange columns based on the column header and always put them in the same order? so if i run the macro on user1 or user2's spreadsheet it'll rearrange the data to the order I want.
sorry if this doesn't make sense, i'm just teaching myself how to do VB script lol, i've managed to make a script to format and highlight specific cells but i can't figure out how to do this.
for example I want columns in order of column A, B, C, D etc
user1 may have columns in order of B, D, A, C and user 2 may have it in C, B, D, A.
luckily the column header names will always be consistant, can someone point me to a macro that will rerrange columns based on the column header and always put them in the same order? so if i run the macro on user1 or user2's spreadsheet it'll rearrange the data to the order I want.
sorry if this doesn't make sense, i'm just teaching myself how to do VB script lol, i've managed to make a script to format and highlight specific cells but i can't figure out how to do this.