rearranging data

  • Thread starter Thread starter Taru
  • Start date Start date
T

Taru

I've got a database with a ID--such as TC38493--in column A, but not in
every row. Instead its the ID followed by more information about that
ID. And the information is contained in more then one cells in the rows
below it. Unfortunately the number of rows of information is not a
regular amount, sometimes its 2 sometimes is 7 rows.

TC389214
Information Information Information
Information Information Information
Information Information Information
TC298315
Information Information Information
Information Information Information
Information Information Information
Information Information Information
Information Information Information
TC073847
Information Information Information
Information Information Information

Then in my second document I've got a lot of these IDs listed. I need
to search Document1 with the ID from Document2 and when it finds
anything it will paste all of the information--whether its 2 rows or
7--back in document2.
Anyone want to write me a program, or at least start me off? I know
the very basics of VBA. If you'd like more information just ask.
 
could someone at least tell me if it would be easier to make a progra
that would put all the information in one row, then make a find an
paste program. Or would it be easier to just make one big program?

Also what exactly is the command to paste something, that whol
proccess confuses me
 
Ok, someone at least help me with this part.

I want to move the Information all into the same row as the ID. So I
want this

ID
Information Information Information

to look like this

ID Information Information Information

Some usefull characteristics is that all of the IDs start with this '>'
and all of the information starts with 'GO:' also the information in
each row is form column A to column G. Someone please help, if I can
consolodate all of the information into the same row as its ID then I
can do what I need.
 
Friday this forum was really good to me, is there no one on here on
Monday? Comeon, I need some help here guys.
 
Try this (part only)

Sub t()
Dim rng As Range
Dim c As Range

lastrow = Cells(Rows.Count, 1).End(xlUp).Row
For i = lastrow To 1 Step -1

If Left(Cells(i, 1), 2) = "TC" Then
Debug.Print i, lastrow
Set rng = Range(Cells(i + 1, 1), Cells(lastrow, 3))
j = 0
For Each c In rng
j = j + 1
Cells(i, j + 1) = c
Next c
lastrow = i - 1
End If

Next i
End Sub
 
Back
Top