harolda1980
Gebruiker
- Lid geworden
- 7 aug 2007
- Berichten
- 488
Ik had deze code gevonden en bewerkt zodat hij in een rapport kon kijken of in kolom 8 het groep nummer staat wat hij moet hebben.
Daarnaast telt en rekent hij deze regel uit.
Alleen nu gaat hij mis in deze regel
de methode of eigenschappen worden niet ondersteunt. Hoe los ik dit op?
Daarnaast telt en rekent hij deze regel uit.
Alleen nu gaat hij mis in deze regel
Code:
For lCount = 1 To Rapportfile.Sheets(2).WorksheetFunction.CountIf(Columns(8), B_groep)
de methode of eigenschappen worden niet ondersteunt. Hoe los ik dit op?
Code:
Dim Bonuswaarden As Currency
Dim lCount As Long
Dim rFoundCell As Range
Dim Afname_T As Double
Dim HL_T As Double
Dim HL As Double
Set rFoundCell = Rapportfile.Sheets(2).Range("H8")
For lCount = 1 To Rapportfile.Sheets(2).WorksheetFunction.CountIf(Columns(8), B_groep)
Set rFoundCell = Rapportfile.Sheets(2).Columns(8).Find(What:=B_groep, After:=rFoundCell, LookIn:=xlValues, LookAt:=xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext, MatchCase:=False)
With rFoundCell
Afname_T = .Offset(0, -2).Value
HL_T = .Offset(0, 1).Value
HL = 0
HL = HL + Afname_T * HL_T / 1000
End With
Next lCount
With Rapportfile.Sheets(1)
.Cells(Rapportfile_row, 1).Value = B_IDdb
.Cells(Rapportfile_row, 2).Value = Omschrijving & " Groep " & B_groep
.Cells(Rapportfile_row, 3).Value = HL
.Cells(Rapportfile_row, 4).Value = CDbl(B_rk)
.Cells(Rapportfile_row, 5).Value = CCur(Round(HL * B_rk, 2))
End With
Rapportfile_totaal = Rapportfile_totaal + CCur(Round(HL * B_rk, 2))
Rapportfile_row = Rapportfile_row + 1