PC Review


Reply
Thread Tools Rate Thread

copy multiple columns

 
 
Milax
Guest
Posts: n/a
 
      4th Mar 2007
Can somebody help me, I need to copy values from multiple columns to one
row, for example:

A1,B1,C1,D1
A2,B2,C2,D2
A3,B3,C3,D3

in

A1,B1,C1,D1,A2,B2,C2,D2,A3,B3,C3,D3.

I don't know witch object (Range or Cell) and its parameters to us.

Thanks!
 
Reply With Quote
 
 
 
 
=?Utf-8?B?Sm9lbA==?=
Guest
Posts: n/a
 
      4th Mar 2007
Cell is index with a row number and a column number like Cells(1,3) which is
row 1 and column C.

Range has multiple for mats. the simple one is

Range("A3") where A3 is a character string. Range can also be made of cells
such as

Range(Cells(1,3),Cells(2,6))

I usually prefer to use a range with an offset such as

Range("A33").offset(rowoffset:=2,columnoffset:=3)

this format is nice because you can put it in a for loop and ichange the
rows or columns

for i = 1 to 10

Range("A33").offset(rowoffset:=i,columnoffset:=3)

Next i


Example 1
MyColoffset = 0
For RowCount = 1 To 3


Range("A14").Offset(rowoffset:=RowCount - 1, columnoffset:=0).Copy _
Destination:=Range("A10"). _
Offset(rowoffset:=0, columnoffset:=4 * (RowCount - 1))


Next RowCount
newrange
next rowcount

Example 2

Set oldrange = Range("A14")
Set newrange = Range("A10")
MyColoffset = 0
For RowCount = 1 To 3

oldrange.Offset(rowoffset:=RowCount - 1, columnoffset:=0).Copy _
Destination:=newrange. _
Offset(rowoffset:=0, columnoffset:=4 * (RowCount - 1))

Next RowCount
"Milax" wrote:

> Can somebody help me, I need to copy values from multiple columns to one
> row, for example:
>
> A1,B1,C1,D1
> A2,B2,C2,D2
> A3,B3,C3,D3
>
> in
>
> A1,B1,C1,D1,A2,B2,C2,D2,A3,B3,C3,D3.
>
> I don't know witch object (Range or Cell) and its parameters to us.
>
> Thanks!
>

 
Reply With Quote
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Copy Columns from multiple workbooks Jen Microsoft Excel Programming 1 18th May 2009 01:45 AM
Help to copy multiple columns to a spreadsheet Retread Microsoft Excel Worksheet Functions 3 12th Jun 2008 08:29 PM
Copy the same 2 columns from multiple spreadsheets into one new sh Tas Microsoft Excel Misc 0 7th Dec 2007 12:04 AM
VBA: Copy from columns on multiple worksheets =?Utf-8?B?ZGRhdGU=?= Microsoft Excel Programming 0 27th Oct 2004 12:45 AM
Copy the row multiple times while translating the columns Anamik Microsoft Excel Misc 2 19th Oct 2004 11:08 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 05:28 AM.