![]() |
Need help with Macro in moving columns
I need help in creating a VBA macro in moving columns. I do know that the
following macro would cut and move column a to column b, but it would replace column b with column a's information. So my question is, how do I move column information around based on the header text for each column. So, if column C has the text (Column A), I want the macro to move it to the first column after looking in the first row to see that it says (Column A). Does that make sense. And based on what other column header text information has, be able to format it automatically without using my mouse or keyboard. So the macro would move everything around all on it's own. How would I do this? Sub Macro1() ' ' Macro1 Macro ' Macro recorded 1/11/2006 by BSmith ' ' Columns("A:A").Cut Destination:=Columns("B:B") Columns("B:B").Select End Sub |
Need help with Macro in moving columns
Anybody got an answer to my question?
"Brett Smith" wrote: I need help in creating a VBA macro in moving columns. I do know that the following macro would cut and move column a to column b, but it would replace column b with column a's information. So my question is, how do I move column information around based on the header text for each column. So, if column C has the text (Column A), I want the macro to move it to the first column after looking in the first row to see that it says (Column A). Does that make sense. And based on what other column header text information has, be able to format it automatically without using my mouse or keyboard. So the macro would move everything around all on it's own. How would I do this? Sub Macro1() ' ' Macro1 Macro ' Macro recorded 1/11/2006 by BSmith ' ' Columns("A:A").Cut Destination:=Columns("B:B") Columns("B:B").Select End Sub |
All times are GMT +1. The time now is 11:29 PM. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com