mitch.bergmans
New Member
- Joined
- Feb 11, 2005
- Messages
- 9
Hi all,
What I want to do is select a couple of columns out of 150 columns and paste them on the next sheet trhough a macro. This is quite easy, but the problem is: The columns I want to copy are never in the same position.
For Example: The first Column I want to copy is : RECORD ID. Sometimes its in column AN but next month it could be column AE. So to avoid that I use the CTRL+f function within my macro. And then my problem starts. After de search the cursor is op top of the right coluwn. I want to copy that column without saying what column it exactly is. Below I´ll show you my Marco for now:
The problem is: Columns("AN:AN").Select. There should be a formula which says: Select entirecolumn. without registrating it´s concerning column AN.
Can some1 help me PLZ?
Mitch
What I want to do is select a couple of columns out of 150 columns and paste them on the next sheet trhough a macro. This is quite easy, but the problem is: The columns I want to copy are never in the same position.
For Example: The first Column I want to copy is : RECORD ID. Sometimes its in column AN but next month it could be column AE. So to avoid that I use the CTRL+f function within my macro. And then my problem starts. After de search the cursor is op top of the right coluwn. I want to copy that column without saying what column it exactly is. Below I´ll show you my Marco for now:
Code:
Sheets("output").Select
Range("A1").Select
Cells.Find(What:="RECORD ID", After:=ActiveCell, LookIn:=xlFormulas,
LookAt _:=xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext,
MatchCase:= _False, SearchFormat:=False).Activate
Columns("AN:AN").Select
Selection.Copy
Sheets("sheet2").Select
Range("A1").Select
ActiveSheet.Paste
Can some1 help me PLZ?
Mitch