View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
JS SL JS SL is offline
external usenet poster
 
Posts: 49
Default Search specific columnheading and copy/insert this column to locationcolumn A

Goodmorning,

In a macro I copy/insert a certain column to A.
This is mostly the same column location, but.... it's not for sure. It should be nice if the macro check this first. It's a bit a nice to have macro :)

Actions;
1) In the active sheet search for the column with in the headingrow (row1) a specific text, like for example 'ABCD'.

2a) If not found this columnheading give a popup message "Columnheading 'ABCD' not exist". Then the macro stops.
2b) If found columnheading 'ABCD' but this is column A then give a popup message "Columnheading 'ABCD' is already placed on A". Then the macro stops.

3) If found, and not placed on location Column A, then copy this whole column and copy/insert this column at the place of column A. Then this become column A and all the other columns will move to the right.


regards, Johan