PDA

View Full Version : Solved: need help



neditheg
10-27-2008, 05:02 AM
Hello guys,

I need some help!

I've attached an excel file with a part of my database components.
so my db loks like this

nrcrt | Name | Adrees | Postal Code | Town | Phone
1 | AA | adr1 | PC1 | T 1 | P1
2 | BB | adr2 | PC2 | T1 | P2
3 | CC | adr3 | PC3 | T1 |P3
...................................................................
40 |AB | adr40 | PC40 |T2 |P40
41 |AC |adr41 | PC41 | T2 |P41
.....................................................................
100 | GA |adr100 | PC100 |T3 |P100
101 |GB |adr101 | PC101 | T3 |P101
.....................................................................
2000 |ZA |adr2000 |PC2000 | T20 |P2000
2001 |ZB |adr2001 |PC2001 | T20 |P2001


I want to cut /copy first 5 rows with T1 , T2 ... T20

Is this posible?

Thanks!

u can watch the excel file attached :)

in sheet1 my db .. and in sheet 2 the result i want.

neditheg
10-27-2008, 07:47 AM
Public Sub ProcessData()
Const TEST_COLUMN As String = "A"
Dim i As Long
Dim iLastRow As Long
Dim cell As Range
Dim sh As Worksheet
Dim rng As Range

With ActiveSheet

iLastRow = .Cells(.Rows.Count, TEST_COLUMN).End(xlUp).Row
For i = 2 To iLastRow
If Application.CountIf(.Cells(1, "E").Resize(i), .Cells(i, "E")) > 50 Then
If rng Is Nothing Then
Set rng = .Rows(i)
Else
Set rng = Union(rng, .Rows(i))
End If
End If
Next i

End With

If Not rng Is Nothing Then rng.Delete

End Sub


:) my bro did it :)

thanks !!

mdmackillop
10-27-2008, 11:37 AM
Please give your questions meaningful titles.