Sub Consolidator()
Dim rng As Range
Dim lng As Long
Dim var As Variant
With Worksheets("Sheet1")
lng = Application.CountIf(.Range("D1", .Cells(Rows.Count,
"D").End(xlUp)), "Name of party")
ReDim var(0 To lng, 0 To 4)
var(0, 0) = "Sl No.": var(0, 1) = "Unit No.": var(0, 2) = "Main
Applicant": var(0, 3) = "Total Rec.(RPT) With Interest": var(0, 4) =
"Interest payable"
lng = 1
For Each rng In .Range("D1", .Cells(Rows.Count, "D").End(xlUp))
If Trim(UCase(rng.Value)) = "NAME OF PARTY" Then
Debug.Print .Cells.Find(What:="Unit No:", LookAt:=xlWhole,
After:=rng)(1).Offset(, 1)(1).Address
var(lng, 1) = .Cells.Find(What:="Unit No:",
LookAt:=xlWhole, After:=rng)(1).Offset(, 1)(1).Value
var(lng, 2) = rng(1)(1, 6).Value
With .Cells.Find(What:="Grand Total", LookAt:=xlWhole,
After:=rng)
var(lng, 3) = .Offset(, 2).Value
var(lng, 4) = .Offset(, 29).Value
End With
var(lng, 0) = lng
lng = lng + 1
End If
Next rng
End With
Stop
With Worksheets("Sheet2")
.UsedRange.Clear
.Cells(1).Resize(UBound(var), 5).Value = var
End With
End Sub
Sam Mathai Chacko
On Sat, Dec 3, 2011 at 5:58 PM, Lakshman Prasad <[email protected]>wrote:
> Dear Sam Mathai Chacko,
>
> I have 1 sheet plz see the attached file, i want to collect date form
> sheet1 to like sheet2.
>
> Pl help
>
> Regards
>
> --
> FORUM RULES (934+ members already BANNED for violation)
>
> 1) Use concise, accurate thread titles. Poor thread titles, like Please
> Help, Urgent, Need Help, Formula Problem, Code Problem, and Need Advice
> will not get quick attention or may not be answered.
>
> 2) Don't post a question in the thread of another member.
>
> 3) Don't post questions regarding breaking or bypassing any security
> measure.
>
> 4) Acknowledge the responses you receive, good or bad.
>
> 5) Cross-promotion of, or links to, forums competitive to this forum in
> signatures are prohibited.
>
> NOTE : Don't ever post personal or confidential data in a workbook. Forum
> owners and members are not responsible for any loss.
>
>
> ------------------------------------------------------------------------------------------------------
> To post to this group, send email to [email protected]
>
--
Sam Mathai Chacko
--
FORUM RULES (934+ members already BANNED for violation)
1) Use concise, accurate thread titles. Poor thread titles, like Please Help,
Urgent, Need Help, Formula Problem, Code Problem, and Need Advice will not get
quick attention or may not be answered.
2) Don't post a question in the thread of another member.
3) Don't post questions regarding breaking or bypassing any security measure.
4) Acknowledge the responses you receive, good or bad.
5) Cross-promotion of, or links to, forums competitive to this forum in
signatures are prohibited.
NOTE : Don't ever post personal or confidential data in a workbook. Forum
owners and members are not responsible for any loss.
------------------------------------------------------------------------------------------------------
To post to this group, send email to [email protected]