Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 43
Default Moving columns order

Hi..., I want to move the order of my columns, do you know a more efficient
way besides doing:

Cells.Find(What:="abc").EntireColumn.Cut
Range("A1").Offset(0, 8).EntireColumn.Insert Shift:=xlToRight

probably something like moving column 6 before 3...


thanks,
--
Thank you...
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,501
Default Moving columns order

Hi,

there's no slick method other then cutting. have a look here

http://www.mvps.org/dmcritchie/excel/swap.htm

Mike

"EXCELMACROS" wrote:

Hi..., I want to move the order of my columns, do you know a more efficient
way besides doing:

Cells.Find(What:="abc").EntireColumn.Cut
Range("A1").Offset(0, 8).EntireColumn.Insert Shift:=xlToRight

probably something like moving column 6 before 3...


thanks,
--
Thank you...

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 43
Default Moving columns order

that's what i was afriad... thanks I'll keep doing my cut/insert...
--
Thank you...


"Mike H" wrote:

Hi,

there's no slick method other then cutting. have a look here

http://www.mvps.org/dmcritchie/excel/swap.htm

Mike

"EXCELMACROS" wrote:

Hi..., I want to move the order of my columns, do you know a more efficient
way besides doing:

Cells.Find(What:="abc").EntireColumn.Cut
Range("A1").Offset(0, 8).EntireColumn.Insert Shift:=xlToRight

probably something like moving column 6 before 3...


thanks,
--
Thank you...

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 88
Default Moving columns order

There is also a manual method that's not too time consuming if you only have
to do the column sort once or twice.

Temporarily add a row that will be the index for sorting your columns. For
example:

Col 1 Col 2 Col 3 Col 4 Col 5
apple pear orange grape kiwi
joe jim jan fred sheila
3 5 2 1 4 <---- This will be the sort index

Then select the columns you want to sort, and select "Data/Sort..." from the
menu.
Under "Options..." select "Sort left to right". Then select the inserted
row to sort by. The example will look like:

Col 4 Col 3 Col 1 Col 5 Col 2
grape orange apple kiwi pear
fred jan joe sheila jim
1 2 3 4 5

You can then delete the index row.

HTH,

Eric
  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 43
Default Moving columns order

that's a good idea.., I guess i can make that part of my macro, just
wondering which one is more slick/efficient, cutting - inserting or adding a
row with order number and then have the macro sort left to right columns.
--
Thank you...


"egun" wrote:

There is also a manual method that's not too time consuming if you only have
to do the column sort once or twice.

Temporarily add a row that will be the index for sorting your columns. For
example:

Col 1 Col 2 Col 3 Col 4 Col 5
apple pear orange grape kiwi
joe jim jan fred sheila
3 5 2 1 4 <---- This will be the sort index

Then select the columns you want to sort, and select "Data/Sort..." from the
menu.
Under "Options..." select "Sort left to right". Then select the inserted
row to sort by. The example will look like:

Col 4 Col 3 Col 1 Col 5 Col 2
grape orange apple kiwi pear
fred jan joe sheila jim
1 2 3 4 5

You can then delete the index row.

HTH,

Eric

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
moving row data to a colunm in sorted order moving row data to a column in a sorted Excel Worksheet Functions 9 February 23rd 10 10:54 PM
How to specify order of moving to unlocked cells in a protected sh mwood Excel Discussion (Misc queries) 1 July 16th 09 06:45 PM
moving cells to a predetermined order Jonathan Excel Discussion (Misc queries) 1 September 23rd 05 12:01 AM
VBA for tab order/moving cursor to a certain cell Frederic Excel Programming 1 July 7th 05 03:57 PM
Moving a row to new work sheet/book if order=yes eddy f Excel Programming 2 February 22nd 04 04:15 PM


All times are GMT +1. The time now is 09:27 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"