- Katılım
- 24 Şubat 2007
- Mesajlar
- 31
- Excel Vers. ve Dili
- 2003 tr
arkadaşlar, aşağıya yazmış olduğum kodları nasıl kısaltabiliriz. bu kodları her satır için yazmam mümkün değil. yaklaşık olarak 5000 satır var
Sub BULAKTAR()
Set S1 = Sheets("1")
Set S2 = Sheets("SONUC")
SATIR = 1
For A = S2.[C2] To S2.[X2]
If A = S2.[AH1] Then
S1.Cells(SATIR, 1) = S2.[C2]
S1.Cells(SATIR, 2) = S2.[D2]
S1.Cells(SATIR, 3) = S2.[E2]
S1.Cells(SATIR, 4) = S2.[F2]
S1.Cells(SATIR, 5) = S2.[G2]
S1.Cells(SATIR, 6) = S2.[H2]
S1.Cells(SATIR, 7) = S2.[I2]
S1.Cells(SATIR, 8) = S2.[J2]
S1.Cells(SATIR, 9) = S2.[K2]
S1.Cells(SATIR, 10) = S2.[L2]
S1.Cells(SATIR, 11) = S2.[M2]
S1.Cells(SATIR, 12) = S2.[N2]
S1.Cells(SATIR, 13) = S2.[O2]
S1.Cells(SATIR, 14) = S2.[P2]
S1.Cells(SATIR, 15) = S2.[Q2]
S1.Cells(SATIR, 16) = S2.[R2]
S1.Cells(SATIR, 17) = S2.[S2]
S1.Cells(SATIR, 18) = S2.[T2]
S1.Cells(SATIR, 19) = S2.[U2]
S1.Cells(SATIR, 20) = S2.[V2]
S1.Cells(SATIR, 21) = S2.[W2]
S1.Cells(SATIR, 22) = S2.[X2]
End If
Next
SATIR = SATIR + 1
For B = S2.[C3] To S2.[X3]
If B = S2.[AH1] Then
S1.Cells(SATIR, 1) = S2.[C3]
S1.Cells(SATIR, 2) = S2.[D3]
S1.Cells(SATIR, 3) = S2.[E3]
S1.Cells(SATIR, 4) = S2.[F3]
S1.Cells(SATIR, 5) = S2.[G3]
S1.Cells(SATIR, 6) = S2.[H3]
S1.Cells(SATIR, 7) = S2.[I3]
S1.Cells(SATIR, 8) = S2.[J3]
S1.Cells(SATIR, 9) = S2.[K3]
S1.Cells(SATIR, 10) = S2.[L3]
S1.Cells(SATIR, 11) = S2.[M3]
S1.Cells(SATIR, 12) = S2.[N3]
S1.Cells(SATIR, 13) = S2.[O3]
S1.Cells(SATIR, 14) = S2.[P3]
S1.Cells(SATIR, 15) = S2.[Q3]
S1.Cells(SATIR, 16) = S2.[R3]
S1.Cells(SATIR, 17) = S2.[S3]
S1.Cells(SATIR, 18) = S2.[T3]
S1.Cells(SATIR, 19) = S2.[U3]
S1.Cells(SATIR, 20) = S2.[V3]
S1.Cells(SATIR, 21) = S2.[W3]
S1.Cells(SATIR, 22) = S2.[X3]
End If
Next
End Sub
bizlerden yardımlarını esirgemeyen arkadaşlara şimdiden teşekkür ederim.
Sub BULAKTAR()
Set S1 = Sheets("1")
Set S2 = Sheets("SONUC")
SATIR = 1
For A = S2.[C2] To S2.[X2]
If A = S2.[AH1] Then
S1.Cells(SATIR, 1) = S2.[C2]
S1.Cells(SATIR, 2) = S2.[D2]
S1.Cells(SATIR, 3) = S2.[E2]
S1.Cells(SATIR, 4) = S2.[F2]
S1.Cells(SATIR, 5) = S2.[G2]
S1.Cells(SATIR, 6) = S2.[H2]
S1.Cells(SATIR, 7) = S2.[I2]
S1.Cells(SATIR, 8) = S2.[J2]
S1.Cells(SATIR, 9) = S2.[K2]
S1.Cells(SATIR, 10) = S2.[L2]
S1.Cells(SATIR, 11) = S2.[M2]
S1.Cells(SATIR, 12) = S2.[N2]
S1.Cells(SATIR, 13) = S2.[O2]
S1.Cells(SATIR, 14) = S2.[P2]
S1.Cells(SATIR, 15) = S2.[Q2]
S1.Cells(SATIR, 16) = S2.[R2]
S1.Cells(SATIR, 17) = S2.[S2]
S1.Cells(SATIR, 18) = S2.[T2]
S1.Cells(SATIR, 19) = S2.[U2]
S1.Cells(SATIR, 20) = S2.[V2]
S1.Cells(SATIR, 21) = S2.[W2]
S1.Cells(SATIR, 22) = S2.[X2]
End If
Next
SATIR = SATIR + 1
For B = S2.[C3] To S2.[X3]
If B = S2.[AH1] Then
S1.Cells(SATIR, 1) = S2.[C3]
S1.Cells(SATIR, 2) = S2.[D3]
S1.Cells(SATIR, 3) = S2.[E3]
S1.Cells(SATIR, 4) = S2.[F3]
S1.Cells(SATIR, 5) = S2.[G3]
S1.Cells(SATIR, 6) = S2.[H3]
S1.Cells(SATIR, 7) = S2.[I3]
S1.Cells(SATIR, 8) = S2.[J3]
S1.Cells(SATIR, 9) = S2.[K3]
S1.Cells(SATIR, 10) = S2.[L3]
S1.Cells(SATIR, 11) = S2.[M3]
S1.Cells(SATIR, 12) = S2.[N3]
S1.Cells(SATIR, 13) = S2.[O3]
S1.Cells(SATIR, 14) = S2.[P3]
S1.Cells(SATIR, 15) = S2.[Q3]
S1.Cells(SATIR, 16) = S2.[R3]
S1.Cells(SATIR, 17) = S2.[S3]
S1.Cells(SATIR, 18) = S2.[T3]
S1.Cells(SATIR, 19) = S2.[U3]
S1.Cells(SATIR, 20) = S2.[V3]
S1.Cells(SATIR, 21) = S2.[W3]
S1.Cells(SATIR, 22) = S2.[X3]
End If
Next
End Sub
bizlerden yardımlarını esirgemeyen arkadaşlara şimdiden teşekkür ederim.