- Katılım
- 24 Şubat 2007
- Mesajlar
- 31
- Excel Vers. ve Dili
- 2003 tr
Set rng = Range("A2:G2")
Cells(2, 8).Value = WorksheetFunction.CountIf(rng, TextBox107.Text)
Cells(2, 9).Value = WorksheetFunction.CountIf(rng, TextBox108.Text)
Cells(2, 10).Value = WorksheetFunction.CountIf(rng, TextBox109.Text)
Cells(2, 11).Value = WorksheetFunction.CountIf(rng, TextBox110.Text)
Cells(2, 12).Value = WorksheetFunction.CountIf(rng, TextBox111.Text)
Cells(2, 13).Value = WorksheetFunction.CountIf(rng, TextBox112.Text)
Set rng = Range("A3:G3")
Cells(3, 8).Value = WorksheetFunction.CountIf(rng, TextBox107.Text)
Cells(3, 9).Value = WorksheetFunction.CountIf(rng, TextBox108.Text)
Cells(3, 10).Value = WorksheetFunction.CountIf(rng, TextBox109.Text)
Cells(3, 11).Value = WorksheetFunction.CountIf(rng, TextBox110.Text)
Cells(3, 12).Value = WorksheetFunction.CountIf(rng, TextBox111.Text)
Cells(3, 13).Value = WorksheetFunction.CountIf(rng, TextBox112.Text)
.........................
.........................
.........................
Arkadaşlar bu şekilde yüzlerce satırlık kodları nasıl sadeleştirebilirim.
Yani Range("A2:G2") kodu için bir döngü oluşturabilirmiyiz.
Cells(2, 8).Value = WorksheetFunction.CountIf(rng, TextBox107.Text)
Cells(2, 9).Value = WorksheetFunction.CountIf(rng, TextBox108.Text)
Cells(2, 10).Value = WorksheetFunction.CountIf(rng, TextBox109.Text)
Cells(2, 11).Value = WorksheetFunction.CountIf(rng, TextBox110.Text)
Cells(2, 12).Value = WorksheetFunction.CountIf(rng, TextBox111.Text)
Cells(2, 13).Value = WorksheetFunction.CountIf(rng, TextBox112.Text)
Set rng = Range("A3:G3")
Cells(3, 8).Value = WorksheetFunction.CountIf(rng, TextBox107.Text)
Cells(3, 9).Value = WorksheetFunction.CountIf(rng, TextBox108.Text)
Cells(3, 10).Value = WorksheetFunction.CountIf(rng, TextBox109.Text)
Cells(3, 11).Value = WorksheetFunction.CountIf(rng, TextBox110.Text)
Cells(3, 12).Value = WorksheetFunction.CountIf(rng, TextBox111.Text)
Cells(3, 13).Value = WorksheetFunction.CountIf(rng, TextBox112.Text)
.........................
.........................
.........................
Arkadaşlar bu şekilde yüzlerce satırlık kodları nasıl sadeleştirebilirim.
Yani Range("A2:G2") kodu için bir döngü oluşturabilirmiyiz.
