Senso
Inventaris
- Lid geworden
- 13 jun 2016
- Berichten
- 11.673
- Besturingssysteem
- W10 Pro en W11 Pro
- Office versie
- Office 2007 H&S en Office 2021 Prof Plus
Zou deze werken of zitten er direct al fouten in?
Ik wil dus in kolom C cel C102 invullen =SomKleur(C1:C100) en dat dan in die kolom de cellen met een groene kleur worden opgeteld. En dat ook voor kolom E en G allemaal wel apart.
Code:
Public Function SomKleur(C1,C100;E1,E100;G1,G100) As Double
application.volatile
Dim totaal As double, kleur As Long
Dim c As Range
kleur = +5
For Each c In Optelbereik.Cells
If c.Interior.ColorIndex = kleur and IsNumeric(c.value) Then
totaal = totaal +c.Value
End If
Next c
somkleur = totaal
End Function
Ik wil dus in kolom C cel C102 invullen =SomKleur(C1:C100) en dat dan in die kolom de cellen met een groene kleur worden opgeteld. En dat ook voor kolom E en G allemaal wel apart.
Laatst bewerkt: