PC Review


Reply
Thread Tools Rate Thread

Data concantating

 
 
RobM
Guest
Posts: n/a
 
      4th Jul 2008
Any idea's as to take data that looks like this:

1st column 2nd column
10075 6L
10075 6M
10075 6O

And make it look like this:

1st column 2nd column 3rd column 4th column
10075 6L 6M 6N

 
Reply With Quote
 
 
 
 
Tim Zych
Guest
Posts: n/a
 
      4th Jul 2008
A quick answer based on the data is to copy the 2nd column and
pastespecial -> Transpose. Since your 1st column has only 1 unique value
that will work without the need of a macro.

--
Tim Zych
www.higherdata.com
Compare data in worksheets and find differences with Workbook Compare
A free, powerful, flexible Excel utility


"RobM" <(E-Mail Removed)> wrote in message
news:6BDC35DC-AD6D-4107-8A7E-(E-Mail Removed)...
> Any idea's as to take data that looks like this:
>
> 1st column 2nd column
> 10075 6L
> 10075 6M
> 10075 6O
>
> And make it look like this:
>
> 1st column 2nd column 3rd column 4th column
> 10075 6L 6M 6N
>



 
Reply With Quote
 
Joel
Guest
Posts: n/a
 
      4th Jul 2008
Sub move_to_columns()

Sh1RowCount = 1
Sh2RowCount = 0
Sh2ColCount = 2
With Sheets("Sheet1")
ID = ""
Do While .Range("A" & Sh1RowCount) <> ""
NewID = .Range("A" & Sh1RowCount)
Data = .Range("B" & Sh1RowCount)
With Sheets("Sheet2")
If NewID = ID Then
.Cells(Sh2RowCount, Sh2ColCount) = Data
Sh2ColCount = Sh2ColCount + 1
Else
ID = NewID
Sh2RowCount = Sh2RowCount + 1
.Range("A" & Sh2RowCount) = ID
.Cells(Sh2RowCount, "B") = Data
Sh2ColCount = 3
End If
End With
Sh1RowCount = Sh1RowCount + 1
Loop
End With

End Sub


"RobM" wrote:

> Any idea's as to take data that looks like this:
>
> 1st column 2nd column
> 10075 6L
> 10075 6M
> 10075 6O
>
> And make it look like this:
>
> 1st column 2nd column 3rd column 4th column
> 10075 6L 6M 6N
>

 
Reply With Quote
 
ryguy7272
Guest
Posts: n/a
 
      4th Jul 2008
Sub newlist()
Set w1 = Sheets("Sheet1")
Set w2 = Sheets("Sheet2")
w2.Cells(1, 1).Value = w1.Cells(1, 1).Value
w2.Cells(1, 2).Value = w1.Cells(1, 2).Value
Ide = Cells(1, 1).Value
w1.Activate
n = Cells(Rows.count, 1).End(xlUp).Row
k = 3
kk = 1
For i = 2 To n
If w1.Cells(i, 1).Value = Ide Then
w2.Cells(kk, k).Value = w1.Cells(i, 2).Value
k = k + 1
Else
kk = kk + 1
k = 3
Ide = w1.Cells(i, 1).Value
w2.Cells(kk, 1).Value = Ide
w2.Cells(kk, 2).Value = w1.Cells(i, 2).Value
End If
Next
End Sub

Regards
Ryan---

--
RyGuy


"Joel" wrote:

> Sub move_to_columns()
>
> Sh1RowCount = 1
> Sh2RowCount = 0
> Sh2ColCount = 2
> With Sheets("Sheet1")
> ID = ""
> Do While .Range("A" & Sh1RowCount) <> ""
> NewID = .Range("A" & Sh1RowCount)
> Data = .Range("B" & Sh1RowCount)
> With Sheets("Sheet2")
> If NewID = ID Then
> .Cells(Sh2RowCount, Sh2ColCount) = Data
> Sh2ColCount = Sh2ColCount + 1
> Else
> ID = NewID
> Sh2RowCount = Sh2RowCount + 1
> .Range("A" & Sh2RowCount) = ID
> .Cells(Sh2RowCount, "B") = Data
> Sh2ColCount = 3
> End If
> End With
> Sh1RowCount = Sh1RowCount + 1
> Loop
> End With
>
> End Sub
>
>
> "RobM" wrote:
>
> > Any idea's as to take data that looks like this:
> >
> > 1st column 2nd column
> > 10075 6L
> > 10075 6M
> > 10075 6O
> >
> > And make it look like this:
> >
> > 1st column 2nd column 3rd column 4th column
> > 10075 6L 6M 6N
> >

 
Reply With Quote
 
RobM
Guest
Posts: n/a
 
      12th Jul 2008
Thanks Joel, now all I need to do is figure out how to put this in the excel
workbook as a Macro?

Rob

"Joel" wrote:

> Sub move_to_columns()
>
> Sh1RowCount = 1
> Sh2RowCount = 0
> Sh2ColCount = 2
> With Sheets("Sheet1")
> ID = ""
> Do While .Range("A" & Sh1RowCount) <> ""
> NewID = .Range("A" & Sh1RowCount)
> Data = .Range("B" & Sh1RowCount)
> With Sheets("Sheet2")
> If NewID = ID Then
> .Cells(Sh2RowCount, Sh2ColCount) = Data
> Sh2ColCount = Sh2ColCount + 1
> Else
> ID = NewID
> Sh2RowCount = Sh2RowCount + 1
> .Range("A" & Sh2RowCount) = ID
> .Cells(Sh2RowCount, "B") = Data
> Sh2ColCount = 3
> End If
> End With
> Sh1RowCount = Sh1RowCount + 1
> Loop
> End With
>
> End Sub
>
>
> "RobM" wrote:
>
> > Any idea's as to take data that looks like this:
> >
> > 1st column 2nd column
> > 10075 6L
> > 10075 6M
> > 10075 6O
> >
> > And make it look like this:
> >
> > 1st column 2nd column 3rd column 4th column
> > 10075 6L 6M 6N
> >

 
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
Save 60% on Data Entry, Data Conversion, Data Processing Services byOffshore-Data-Entry dataentryoffshore@gmail.com Microsoft Excel Programming 0 4th Jun 2008 04:02 PM
Save 60% on Data Entry, Data Conversion, Data Processing Services byOffshore-Data-Entry dataentryoffshore@gmail.com Microsoft Excel Programming 0 4th Jun 2008 04:00 PM
Professional Data Conversion,Data Formats and Affordable Data EntryServices by Data Entry India Data Entry India Microsoft Access Form Coding 0 31st Mar 2008 11:50 AM
Data Entry Online, Data Format, Data Conversion and Data EntryServices through Data Entry Outsourcing admin.dataentryoutsourcing@gmail.com Microsoft Excel Misc 0 20th Mar 2008 12:45 PM
Data Entry Online, Data Format, Data Conversion and Data EntryServices through Data Entry Outsourcing admin.dataentryoutsourcing@gmail.com Microsoft Access Form Coding 0 20th Mar 2008 12:44 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 10:18 AM.