Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi,
I would like to copy from Sheet1 Columns B ,A, C in that order to Sheet 2 Columns A , B, C can this be done by array i.e myarray(B,A,C) Thanks in advance -- Message posted via OfficeKB.com http://www.officekb.com/Uwe/Forums.a...mming/201005/1 |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I found this code but the order of columns remains A,B,C
myarray = "B:B,A:A,C:C" Worksheets("Sheet1").Range(myarray).Copy Worksheets("Sheet2").Range("A1") FIRSTROUNDKO wrote: Hi, I would like to copy from Sheet1 Columns B ,A, C in that order to Sheet 2 Columns A , B, C can this be done by array i.e myarray(B,A,C) Thanks in advance -- Message posted via OfficeKB.com http://www.officekb.com/Uwe/Forums.a...mming/201005/1 |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
here is the answer
Sub assignArray() Dim Arr(3) Dim X As Long Arr(1) = "B:B" Arr(2) = "A:A" Arr(3) = "C:C" For X = 1 To 3 ' Columns("K:K").Select Worksheets("Sheet1").Columns(Arr(X)).Copy Worksheets ("Sheet2").Cells(1, X) Next X End Sub FIRSTROUNDKO wrote: I found this code but the order of columns remains A,B,C myarray = "B:B,A:A,C:C" Worksheets("Sheet1").Range(myarray).Copy Worksheets("Sheet2").Range("A1") Hi, [quoted text clipped - 9 lines] Thanks in advance -- Message posted via OfficeKB.com http://www.officekb.com/Uwe/Forums.a...mming/201005/1 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Variant Array Copy, Array row contains Object | Excel Programming | |||
Change a Macro - Copy in Columns instead of copy in Rows | Excel Programming | |||
copy one array formula to an array range | Excel Programming | |||
How do I copy columns between worksheets if the columns don't matc | Excel Worksheet Functions | |||
Copy Array pointer rather than entire array | Excel Programming |