Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default Move contents of entire column

Is there a way to programatically move the contents of an
entire column to another? (i.e. switch the contents of
column A with the contents of column C). Any help is
greatly appreciated as always. Thankyou.

Matthew.
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default Move contents of entire column

Hi Matthew,

Columns("A:A").Cut
Columns("C:C").Insert Shift:=xlToRight
Columns("C:C").Cut
Columns("A:A").Insert Shift:=xlToRight

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)

"Matthew" wrote in message
...
Is there a way to programatically move the contents of an
entire column to another? (i.e. switch the contents of
column A with the contents of column C). Any help is
greatly appreciated as always. Thankyou.

Matthew.



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,885
Default Move contents of entire column

Hi
I would do it as following (and you can record a macro while doing this
manually):
- copy one column to a helper column (e.g. column IV)
- copy col. 2 to column 1
- copy columne IV to column 2


--
Regards
Frank Kabel
Frankfurt, Germany

"Matthew" schrieb im Newsbeitrag
...
Is there a way to programatically move the contents of an
entire column to another? (i.e. switch the contents of
column A with the contents of column C). Any help is
greatly appreciated as always. Thankyou.

Matthew.


  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default Move contents of entire column

Thankyou both for the help. Both ideas worked just fine.
-----Original Message-----
Is there a way to programatically move the contents of an
entire column to another? (i.e. switch the contents of
column A with the contents of column C). Any help is
greatly appreciated as always. Thankyou.

Matthew.
.

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 690
Default Move contents of entire column

I believe this routine would swap Columns 1 & 3 (or A & C)

SwapColumns 1, 3

Sub SwapColumns(c1, c2)
Columns(c1).Copy
Columns(c2).Insert
Columns(c2 + 1).Cut
Columns(c1).Select
ActiveSheet.Paste
Columns(c2 + 1).Delete
End Sub

HTH
Dana DeLouis


"Matthew" wrote in message
...
Is there a way to programatically move the contents of an
entire column to another? (i.e. switch the contents of
column A with the contents of column C). Any help is
greatly appreciated as always. Thankyou.

Matthew.





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
how to move contents in column up one cell pmt Excel Worksheet Functions 2 April 16th 09 03:47 PM
move contents of column C based on criteria related to column A Debra Excel Discussion (Misc queries) 2 December 27th 05 10:25 PM
Macro to remove contents of cell and move all other contents up one row adw223 Excel Discussion (Misc queries) 1 July 1st 05 03:57 PM
Excel: is it possible to move column contents into a line Ginger Excel Discussion (Misc queries) 2 June 16th 05 06:59 PM
Macro to move selected cell contents to a specific column on same row Ben Johnson[_3_] Excel Programming 1 February 10th 04 08:43 PM


All times are GMT +1. The time now is 10:00 AM.

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

About Us

"It's about Microsoft Excel"