Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

VB code to relocated spreadsheet column content 2

Status
Not open for further replies.

okeyuzosike

Programmer
Jun 15, 2007
15
US
Good afternoon,
please can someone show me how to move the content of a column in excel spreadsheet to another column in the same spreadsheet and also to set a specified range of columns to 2; for example I want Columns size of "D" thru "X" to be 2.
Thanks.
Okey.
 
the macro recorder is your friend!

Tools>MAcro>Record New Macro

Rgds, Geoff

We could learn a lot from crayons. Some are sharp, some are pretty and some are dull. Some have weird names and all are different colours but they all live in the same box.

Please read FAQ222-2244 before you ask a question
 
As Geoff said the recorder works magic here. Just remember that you don't need all the "select" commands the recorder uses.

Code:
Columns("B:B").Cut Destination:=Columns("C:C")
Columns("D:X").ColumnWidth = 2

BD
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top