Calcul (moy, max, min...) entre deux classeur
Résolu/Fermé
Quoi29
Messages postés
19
Date d'inscription
mardi 17 avril 2018
Statut
Membre
Dernière intervention
5 septembre 2019
-
Modifié le 17 avril 2018 à 18:45
Quoi29 Messages postés 19 Date d'inscription mardi 17 avril 2018 Statut Membre Dernière intervention 5 septembre 2019 - 30 avril 2018 à 11:40
Quoi29 Messages postés 19 Date d'inscription mardi 17 avril 2018 Statut Membre Dernière intervention 5 septembre 2019 - 30 avril 2018 à 11:40
A voir également:
- Application.worksheetfunction.max
- I14 pro max - Guide
- Deux comptes whatsapp - Guide
- Itinéraire google map entre deux adresses - Guide
- Calcul moyenne excel - Guide
- Min maj - Guide
1 réponse
yg_be
Messages postés
22730
Date d'inscription
lundi 9 juin 2008
Statut
Contributeur
Dernière intervention
26 avril 2024
1 477
17 avril 2018 à 20:13
17 avril 2018 à 20:13
bonjour, "qui ne marche pas": message d'erreur, ?
17 avril 2018 à 20:22
19 avril 2018 à 10:02
Modifié le 19 avril 2018 à 15:36
Ca marche parfaitement, Eureka!
Merci beaucoup pour ton aide
Modifié le 20 avril 2018 à 12:19
J'ai crié victoire trop vite.
Voici comment j'ai incorporé ton code:
'Found the Total and write it in Solution sheet
Set rg = Excel.Application.Workbooks(Imput & ".xlsx").Sheets("Travaille").Range("O3:O" & NbRow)
avg = Application.WorksheetFunction.Sum(rg)
Excel.Application.ThisWorkbook.Sheets("Solution").Range(Column(Version) & "22") = avg
rg.Clear
avg = 0
'Found the Total and write it in Solution sheet
Set rg = Excel.Application.Workbooks(Imput & ".xlsx").Sheets("Travaille").Range("M3:M" & NbRow)
avg = Application.WorksheetFunction.Sum(rg)
Excel.Application.ThisWorkbook.Sheets("Solution").Range(Column(Version) & "24") = avg
rg.Clear
avg = 0
'Found the Total and write it in Solution sheet
Set rg = Excel.Application.Workbooks(Imput & ".xlsx").Sheets("Travaille").Range("P3:P" & NbRow)
avg = Application.WorksheetFunction.Sum(rg)
Excel.Application.ThisWorkbook.Sheets("Solution").Range(Column(Version) & "26") = avg
rg.Clear
avg = 0
'Found the Peak and write it in Solution sheet
Set rg = Excel.Application.Workbooks(Imput & ".xlsx").Sheets("Travaille").Range("D3:D" & NbRow)
avg = Application.WorksheetFunction.Max(rg)
Excel.Application.ThisWorkbook.Sheets("Solution").Range(Column(Version) & "25") = avg
rg.Clear
avg = 0
Lorsque je fais tourner le programme. J'ai l'erreur à la ligne suivante:
avg = Application.WorksheetFunction.Sum(rg)
Avec comme message d'erreur:
"Erreur 1008 le programme ne peut réaliser la fonction sum"
Lorsque je regarde dans mon dossier Excel les cellules O3:O3000 et M3:3000 ont été remplacé par des cases vides. D'où j'imagine le problème de réaliser la fonction sum.
Lorsque j'enlève ton code incorporé mes cellules sont bien présentes et remplis comme il se doit.
Aurais-tu une idée de l'origine de l'erreur?
20 avril 2018 à 12:18
rg.Clear
avg = 0
Les colonnes ne disparaissent plus mais cela bloque comme même au même endroit