Calcul (moy, max, min...) entre deux classeur
Résolu
Quoi29
Messages postés
19
Date d'inscription
Statut
Membre
Dernière intervention
-
Quoi29 Messages postés 19 Date d'inscription Statut Membre Dernière intervention -
Quoi29 Messages postés 19 Date d'inscription Statut Membre Dernière intervention -
A voir également:
- Application.worksheetfunction.max
- Nombre de jours entre deux dates excel - Guide
- Calcul moyenne excel - Guide
- Maj to min - Guide
- Deux ecran pc - Guide
- Driver max - Télécharger - Pilotes & Matériel
1 réponse
yg_be
Messages postés
23541
Date d'inscription
Statut
Contributeur
Dernière intervention
Ambassadeur
1 584
bonjour, "qui ne marche pas": message d'erreur, ?
Ca marche parfaitement, Eureka!
Merci beaucoup pour ton aide
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?
rg.Clear
avg = 0
Les colonnes ne disparaissent plus mais cela bloque comme même au même endroit