----------------------------------------------------
----------------------------------------------------
Last edited by report runner; 09-05-2007 at 08:42 AM.
I am difficulty with an assignment.
I need to take a database report and merge it with a report from a different database. The two reports carry one common identifier (alpha-numeric). Reports convert to excel.
Nuts & Bolts:
One report lists a priority category, project manager's initials, and some financials
ie:
"P07-0599, Project Description, Priority A, PRB, $70,000"
The other report carries monthly financial numbers
ie:
"P07-0599, 70000, 10000, 2500, 40000, 10000, 7500"
I need to create one report showing all detail under the alpha-numeric identifier.
I have explored the "matching", "Consolidation" and "Merging" functions with no success.
I am an engineer turned accountant Can anyone please help? Thanks[/QUOTE]
??????????????????????????????
Is the lack of reply due to poor upfront info or something else???
Hi
Assuming Miscellaneous data is in columns 1-5 and financial data is in columns 6-12 of Sheet1, This code will copy consolidated report to Sheet 2.
Also assume that you know how may rows there (this can be programmatically determined but I am not including.
Public Sub Merge_Reports
For i=1 to numrows
For j=1 to numrows
If Worksheets("Sheet1").Cells(i,1)=_
Worksheets("Sheet1").Cells(j,6) Then
For k=1 to 12
'exclude k=6 to avoid copying id twice
If k<6 then Worksheets("Sheet2").Cells(i,k) _
=Worksheets("Sheet1").Cells(i,k)
If k>6 Then then Worksheets("Sheet2").Cells(i,k) _
=Worksheets("Sheet1").Cells(j,k)
Next
Exit For
End If
Next
Next
End Sub
Hope this helps. - Steve
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks