change data's view

azedac

New Member
Joined
Sep 21, 2006
Messages
2
Hello,

I would like to know, how can I transferre data in a sheet from array to seq.
For example:

from:
A B C
M1 5 4 3
M2 3 2 1
M3 4 3 5

to:

A M1 5
A M2 3
A M3 4
B M1 4
B M2 2
B M3 3
C M1 3
C M2 1
C M3 5

Is exists some routine for this or....?

Thanks a lot.
Azedac
 

Excel Facts

Quick Sum
Select a range of cells. The total appears in bottom right of Excel screen. Right-click total to add Max, Min, Count, Average.

sunnyland

Well-known Member
Joined
Jan 27, 2006
Messages
912
Hie,

In my sample it will copy to column M and N on the same sheet where the code reside from row 1
[double check you don't have anything there before to try the code]

First select the source don't select the heading and give it a name using named range: tocopy [this is the named range use in the code so if you call the range something else change the name in the code]. You need to have the named range before to run the code.

Select the necessary data to copy, don't select the full columns as it will take forever. Then d in the menu do,
insert ...
Name....

If you have the data selected before you should have the address of the range in refers to.

Just change the name to tocopy

In my sample it will copy data in 2 columns M and N if you don't want to use these column change to the code.

To see if it works fine maybe
1) create an empty worksheet.

2)create the named range tocopy

3)Place this code on the empty worksheet

4)Then run the code It will copy to M and N.

If it corresponds to what you wanted then change the column letter to where you want it copied.

Don't place this code on a sheet where you have data in column M and N

Sorry I forgot to paste the code:

Code:
Sub copydown()
Dim rangi As Range, rang As Range
Set rangi = Application.Names("tocopy").RefersToRange
Dim start As Long
start = 1
For x = 1 To rangi.Columns.Count - 1
For Each rang In rangi.Columns(1).Cells
Cells(start, "M") = rang
Cells(start, "N") = rang.Offset(0, x)
start = start + 1
Next
Next
Set rangi = Nothing
Set ran = Nothing
End Sub
 

Forum statistics

Threads
1,141,680
Messages
5,707,788
Members
421,527
Latest member
Tamiwsw

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Top