![]() |
|
Forum
|
|
|
#1 (permalink) |
|
XLDnaute Nouveau
Date d'inscription: décembre 2007
Messages: 5
|
Bonjour à Tous,
J'ai écrit une petite Macro pour faire la somme des celulles non colorées d'une colonne et afficher le résultat dans la celulle ou j'ai lancé la Macro mais c'est la seule chose qui ne fonctionne pas, j'ai donc besoin d'un petit coup de main. Merci par avance ![]() Sub Macro2() ' ' Macro2 Macro ' Macro enregistrée le 30/12/2007 par Karczynski Valentin ' Touche de raccourci du clavier: Ctrl+t ' Dim cell As Range, Somme As Double, ColorIndex As String, Colonne As Double, Rest As Double Dim I As Integer, J As Integer, K As Integer, L As Integer, C As Integer Dim CelCal As String ColorIndex = -4142 Somme = 0 I = 0 CelCal = Selection.Address L = Range(CelCal).Row J = ActiveCell.Row On Error Resume Next Columns(3).Select C = ActiveCell.Column For Each cell In Selection.Cells If cell.Interior.ColorIndex = ColorIndex Then Somme = Somme + _ cell.Value J = cell.Row I = I + 1 If I = L Then Exit For End If Next cell On Error GoTo 0 Set cell = Nothing Range(CelCal).Select MsgBox Somme Range(Somme).Select.Paste End Sub Classeur1.xls |
|
|
|
![]() |
| Liens sociaux |
| Outils de la discussion | |
|
|
Discussions similaires
|
||||
| Discussion | Auteur | Forum | Réponses | Dernier message |
| Macro dont une partie fonctionne et la deuxième (copié-collée) ne fonctionne pas | Youri | Forum Excel | 2 | 22/06/2007 09h32 |
| Collage spécial | magicreme | Forum Excel | 5 | 11/10/2005 14h19 |
| Collage | Loulou | Forum Excel Downloads - Archives | 4 | 28/01/2005 10h47 |
| filtre automatique: fonctionne et puis ne fonctionne plus | Luc | Forum Excel Downloads - Archives | 1 | 28/08/2003 13h15 |
| Collage multiple | Geff de Nîmes | Forum Excel Downloads - Archives | 1 | 25/07/2003 21h13 |