Link to home
Start Free TrialLog in
Avatar of ADRIANA P
ADRIANA PFlag for United States of America

asked on

NEED TRANSFER DATA

HAVE A COLUMN WITH DATA  NEED TO BE REORGANIZED

THIS WAY
CHANGE-FOR-ANALYSIS.xlsx
Avatar of Martin Liss
Martin Liss
Flag of United States of America image

The attached assumes that you want the black cells and that the output goes into the columns you said (M, N and O) and not the ones that you show (N, O and P).

To see the results, go to Sheet1 and press Ctrl+Shift+S
29011545.xlsm
Avatar of ADRIANA P

ASKER

MARTIN

CAN BE A NEW  SHEET TOO

LET'S SAY  I CAN PASTE THE DATA
IN A NEW WOORKBOOK WITH AN SHEET A  COLUMN A  P LASTE THERE
AND A NEW SHEET B CAN BE THE RESULTS
excuse me about the caps on
You may try something like this...
Click the button on Sheet1 to run the below macro to get the desired output on a separate sheet called Output. This sheet will be inserted by the macro if not present in the workbook.

Sub TransposeData()
Dim sws As Worksheet, dws As Worksheet
Dim slr As Long, c As Long
Dim Rng As Range

Application.ScreenUpdating = False
Set sws = Sheets("Sheet1")
slr = sws.Cells(Rows.Count, 5).End(xlUp).Row
On Error Resume Next
Set dws = Sheets("Output")
dws.Cells.Clear
On Error GoTo 0
If dws Is Nothing Then
    Sheets.Add(after:=sws).Name = "Output"
    Set dws = ActiveSheet
End If
For Each Rng In sws.Range("E7:E" & slr).SpecialCells(xlCellTypeConstants, 2).Areas
    c = c + 1
    dws.Cells(1, c).Value = Rng.Cells(1).Offset(-1, -1).Value
    Rng.Offset(-1, 0).Resize(Rng.Cells.Count + 1, 1).Copy dws.Cells(2, c)
Next Rng
dws.Rows(1).HorizontalAlignment = xlCenter
Application.ScreenUpdating = True
End Sub

Open in new window

CHANGE-FOR-ANALYSIS.xlsm
Try my workbook and let me know what needs changing.
Make sure you are looking at Sheet1 and then press and hold the Control and Shit keys and press the "S" key. Then look at sheet2.
This version has a "Transfer" button.
29011545a.xlsm
MARTIN IS ALMOST DONE
BUT
 IS EVERY 12  RANGE
1 IS BLANK
2 TO 13 IS DATA
AND BEGING AGAIN
1 IS BLANK
2 TO 13 IS DATA
Subodh Tiwari (Neeraj)  for you promplty answer

almost work but i ahve over 3000 records
and anfert column 10 phase out the data

have to be  in ranges of 13
1 blank
2
to
13 data
and beging again
1 blank
2  to 13 data
My results are exactly what you show in the example (except for the columns).
Hi Adriana,

Do you want to have max 10 columns of transposed data on one sheet and then start over again transposing the data on the new sheet?
maritn this is what happens
trans.png
Subodh Tiwari (Neeraj)

lets see...
Still hard to guess your end result.
BTW try this to see if this is what you are trying to achieve here.
Sub TransposeData()
Dim sws As Worksheet, dws As Worksheet
Dim slr As Long, c As Long, i As Long
Dim Rng As Range

Application.ScreenUpdating = False
Set sws = Sheets("Sheet1")
slr = sws.Cells(Rows.Count, 5).End(xlUp).Row
c = 1
i = 1
For Each Rng In sws.Range("E7:E" & slr).SpecialCells(xlCellTypeConstants, 2).Areas
    If c = 1 Then
        On Error Resume Next
        Set dws = Sheets("Output" & i)
        dws.Cells.Clear
        On Error GoTo 0
        If dws Is Nothing Then
            Sheets.Add(after:=Sheets(Sheets.Count)).Name = "Output" & i
            Set dws = ActiveSheet
        End If
    End If
    dws.Cells(1, c).Value = Rng.Cells(1).Offset(-1, -1).Value
    Rng.Offset(-1, 0).Resize(Rng.Cells.Count + 1, 1).Copy dws.Cells(2, c)
    c = c + 1
    If c > 10 Then
        c = 1
        i = i + 1
        Set dws = Nothing
    End If
Next Rng
Application.ScreenUpdating = True
End Sub

Open in new window

If you want column A to be blank on all the new sheets, change all the occurrences of c = 1 with c = 2.
this is  what have to be
trans233.png
Can you upload a sample workbook with the desired output mocked up manually as the images you have uploaded so far don't help much as we cannot see the row numbers  and column letters so not sure about the exact position of data on the sheet?
When I click the "Transfer" button I get this on sheet2 which looks like the image you posted.
User generated image
martin  the file you post  to me don't works like that
can you verify please !!
 will be great if work like that

here the data i need to work on  if help to get the result
DATA-ON.xlsx
Subodh Tiwari (Neeraj)

this is what aiget with the code you send me

it don't put the data  on teh ranges  of 13
transpo-c.png
here what's  should comes out  please verify
rigth-data.png
Adrianna, the data on the left side of that picture does not agree with the data on the right side.

In the workbook you posted, please tell me what rows should be in column "M" and what rows should be in column "N".
Well it is still not clear.
Anyways find the attached and click the button to run the code.
And if this is not your desired end result, change the output on the newly added sheets and upload the workbook here.
DATA-ON.xlsm
Subodh Tiwari (Neeraj)

now i get a lot of diferrents sheets with outputs

i need just one sheet output but
the data from one column should be put in 13 rows format all the way along
aloaoutput.png
Can you mock up the desired output based on your sample file and show us what do you need exactly?
If you want to show us a picture the best thing to do is to click this button, click "choose file", select the file, give it a description, and click "Embed".
User generated image
ok i m learning
User generated image
The data under "1" in the left hand side (blank, 824, 705, etc.) does not agree with the data you show under "1" on the right hand side (blank, 417, 279, etc.)
Okay can you check the attached and confirm?
DATA-ON.xlsm
Matin i see sorry
you rigth on that
 excus me for the confusion


but like i say  one column data
to be in 13 ranges with the first blank  2 to 13 with the data and all over
first blank  2 to 13 with the data and all over
I know that the first cell in each set will be blank, but will the 2 to 13 part ever have blank cells. If it does do you want to see the blank cells on the right?
ok  good question !
martin
yes when one blank shoud be there too with not data in but in the same space

13 set
1 blank
2
to
13 with the data

is equal to say 12 data column

but the 1 blank
pull apart the data in the short column
iput inthe same place i mean
Did you check the file I uploaded?
Subodh Tiwari

almost work but
 is taking 13
remember 13 is with first blank and 12 with data
 
1=blank
2
to
13  with data
is equal to 12 data but first blank to separate
I'm sorry but I don't understand what you said. Given this data

824
705
750
232
316
949
240
377
251
719
548
841

065
744
023
857
990
310
530
666
099
822

958
226
179
623
720
748
828
421
746
140
what should be in column "M" and what should be in column "N"?
matin

don't have to be in column m or n
Martin
could be an blank workbook so i can paste there  from the original!

you can put set it so i can use coumn A
I don't care what the output columns are. What should be in the first output column and what should be in the second output column?
you can set it so i can move the data when is ready
I don't care what the output columns are. What should be in the first output column and what should be in the second output column?
Please answer that question using this data which is from your workbook.
824
705
750
232
316
949
240
377
251
719
548
841

065
744
023
857
990
310
530
666
099
822

958
226
179
623
720
748
828
421
746
140
Ok Martin Great !

824  should be in first column    065 second column   958 third column
Two Great Experts here, and still taking so long? LOL
ASKER CERTIFIED SOLUTION
Avatar of Martin Liss
Martin Liss
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Martin Sir,

I have different approach, If you can play around with my code to make it Column wise.
DATA-ON_v3.xlsm
The best !
Martin ! Great Expert !

thats what i need !
Give me a minute and I think I can speed it up.
Martin Sir,

Still its not perfect. Please check again.
There are many columns which are not pulling right data.
Subodh Tiwari you was so  close may be  don't have time  but very good too !
thanks  to you too!
yes is not perfect ! but very closed ! to be
This takes about 8 seconds.
29011545c.xlsm
thge blank data is because have some empty fields in the  12 cycle
there are 12  but the first is the begining of the next
if youcan speed an d make better will be nice !
Please see the 29011545c version I posted above.