Après une journée de recherche, je ne trouve pas pourquoi j'ai une
«erreur d'exécution '1004' : Erreur définie par l'application ou par
l'objet» après la deuxième instruction ci-après :
Cette action est irreversible, confirmez la suppression du commentaire ?
Signaler le commentaire
Veuillez sélectionner un problème
Nudité
Violence
Harcèlement
Fraude
Vente illégale
Discours haineux
Terrorisme
Autre
Michel
Salut,
J'ai teste et pas d'erreur...
As tu un autre code avant ? des donnees specifique dans les cellules que tu selectionnes ?
@+
Michel.
"defluc" a écrit dans le message de news:
Bonjour
Après une journée de recherche, je ne trouve pas pourquoi j'ai une «erreur d'exécution '1004' : Erreur définie par l'application ou par l'objet» après la deuxième instruction ci-après :
As tu un autre code avant ? des donnees specifique dans les cellules que tu
selectionnes ?
@+
Michel.
"defluc" <defluc@scarlet.be> a écrit dans le message de news:
OQMo3FvlGHA.4868@TK2MSFTNGP04.phx.gbl...
Bonjour
Après une journée de recherche, je ne trouve pas pourquoi j'ai une «erreur
d'exécution '1004' : Erreur définie par l'application ou par l'objet»
après la deuxième instruction ci-après :
As tu un autre code avant ? des donnees specifique dans les cellules que tu selectionnes ?
@+
Michel.
"defluc" a écrit dans le message de news:
Bonjour
Après une journée de recherche, je ne trouve pas pourquoi j'ai une «erreur d'exécution '1004' : Erreur définie par l'application ou par l'objet» après la deuxième instruction ci-après :
Après une journée de recherche, je ne trouve pas pourquoi j'ai une «erreur d'exécution '1004' : Erreur définie par l'application ou par l'objet» après la deuxième instruction ci-après :
Chez moi celà fonctionne -- A+ Jean-Claude - Evitez lez gaz mous
In news:OQMo3FvlGHA.4868@TK2MSFTNGP04.phx.gbl,
____________________
Bonjour
Après une journée de recherche, je ne trouve pas pourquoi j'ai une
«erreur d'exécution '1004' : Erreur définie par l'application ou par
l'objet» après la deuxième instruction ci-après :
Après une journée de recherche, je ne trouve pas pourquoi j'ai une «erreur d'exécution '1004' : Erreur définie par l'application ou par l'objet» après la deuxième instruction ci-après :
Chez moi celà fonctionne -- A+ Jean-Claude - Evitez lez gaz mous
isabelle
bonjour luc,
ta macro est t'elle executé par un click sur un bouton de commande ?
isabelle
Bonjour
Après une journée de recherche, je ne trouve pas pourquoi j'ai une «erreur d'exécution '1004' : Erreur définie par l'application ou par l'objet» après la deuxième instruction ci-après :
ta macro est t'elle executé par un click sur un bouton de commande ?
isabelle
Bonjour
Après une journée de recherche, je ne trouve pas pourquoi j'ai une
«erreur d'exécution '1004' : Erreur définie par l'application ou par
l'objet» après la deuxième instruction ci-après :
ta macro est t'elle executé par un click sur un bouton de commande ?
isabelle
Bonjour
Après une journée de recherche, je ne trouve pas pourquoi j'ai une «erreur d'exécution '1004' : Erreur définie par l'application ou par l'objet» après la deuxième instruction ci-après :
Private Sub Worksheet_SelectionChange(ByVal Target As Excel.Range) Dim MaxVal, Rank, Score As Long Dim i, j, FirstPlace, LastPlace, Col, ColHit, ScoreMax, Place, NbrListes, Line As Integer Dim Position, TmpStr As String Dim ListToSort As Range
Rank = ActiveCell.Row Position = ActiveCell.Address LastPlace = 6 NbrCandid = 1 While ActiveSheet.Cells(LastPlace, 2) <> "" LastPlace = LastPlace + 1 Wend NbrCandid = LastPlace - 6 MaxVal = Application.WorksheetFunction.Max(Range(Cells(6, 4), Cells(NbrCandid + 5, 4))) ActiveSheet.ChartObjects("Graphique 1").Activate ActiveChart.ChartArea.Select ActiveChart.Axes(xlValue).Select With ActiveChart.Axes(xlValue) .MinimumScale = -1 * MaxVal .MaximumScale = 0 End With LastPlace = LastPlace - 1 If Rank > 5 Then Application.EnableEvents = False FirstPlace = 1 TmpStr = "E6:E" + Trim(Str(LastPlace)) Range(TmpStr).ClearContents ScoreMax = -100000000 CalcMinMax FirstPlace, LastPlace, ScoreMax Place = 0 For j = FirstPlace To LastPlace + 1 For i = FirstPlace + 5 To LastPlace + 5 Line = Trim(Str(i)) Rank = Range("E" + Trim(Str(Line))).Value Score = Range("D" + Trim(Str(Line))).Value If Val(Rank) = 0 And Score = ScoreMax Then Place = Place + 1 If Score > 0 Then Range("E" + Trim(Str(Line))).Value = Place Exit For End If ScoreMax = -1000000000 CalcMinMax FirstPlace, LastPlace, ScoreMax Next i Next j NbrListes = ActiveWorkbook.Sheets.Count - 4 ColHit = (NbrListes - 1) * 3 + 1 Sheets(6).Activate ActiveSheet.Range(Cells(26, 10), Cells(117, 12)).Select End If Range(Position).Select Application.EnableEvents = True End Sub
Voici la source:
Private Sub Worksheet_SelectionChange(ByVal Target As Excel.Range)
Dim MaxVal, Rank, Score As Long
Dim i, j, FirstPlace, LastPlace, Col, ColHit, ScoreMax, Place,
NbrListes, Line As Integer
Dim Position, TmpStr As String
Dim ListToSort As Range
Rank = ActiveCell.Row
Position = ActiveCell.Address
LastPlace = 6
NbrCandid = 1
While ActiveSheet.Cells(LastPlace, 2) <> ""
LastPlace = LastPlace + 1
Wend
NbrCandid = LastPlace - 6
MaxVal = Application.WorksheetFunction.Max(Range(Cells(6, 4),
Cells(NbrCandid + 5, 4)))
ActiveSheet.ChartObjects("Graphique 1").Activate
ActiveChart.ChartArea.Select
ActiveChart.Axes(xlValue).Select
With ActiveChart.Axes(xlValue)
.MinimumScale = -1 * MaxVal
.MaximumScale = 0
End With
LastPlace = LastPlace - 1
If Rank > 5 Then
Application.EnableEvents = False
FirstPlace = 1
TmpStr = "E6:E" + Trim(Str(LastPlace))
Range(TmpStr).ClearContents
ScoreMax = -100000000
CalcMinMax FirstPlace, LastPlace, ScoreMax
Place = 0
For j = FirstPlace To LastPlace + 1
For i = FirstPlace + 5 To LastPlace + 5
Line = Trim(Str(i))
Rank = Range("E" + Trim(Str(Line))).Value
Score = Range("D" + Trim(Str(Line))).Value
If Val(Rank) = 0 And Score = ScoreMax Then
Place = Place + 1
If Score > 0 Then Range("E" + Trim(Str(Line))).Value = Place
Exit For
End If
ScoreMax = -1000000000
CalcMinMax FirstPlace, LastPlace, ScoreMax
Next i
Next j
NbrListes = ActiveWorkbook.Sheets.Count - 4
ColHit = (NbrListes - 1) * 3 + 1
Sheets(6).Activate
ActiveSheet.Range(Cells(26, 10), Cells(117, 12)).Select
End If
Range(Position).Select
Application.EnableEvents = True
End Sub
Private Sub Worksheet_SelectionChange(ByVal Target As Excel.Range) Dim MaxVal, Rank, Score As Long Dim i, j, FirstPlace, LastPlace, Col, ColHit, ScoreMax, Place, NbrListes, Line As Integer Dim Position, TmpStr As String Dim ListToSort As Range
Rank = ActiveCell.Row Position = ActiveCell.Address LastPlace = 6 NbrCandid = 1 While ActiveSheet.Cells(LastPlace, 2) <> "" LastPlace = LastPlace + 1 Wend NbrCandid = LastPlace - 6 MaxVal = Application.WorksheetFunction.Max(Range(Cells(6, 4), Cells(NbrCandid + 5, 4))) ActiveSheet.ChartObjects("Graphique 1").Activate ActiveChart.ChartArea.Select ActiveChart.Axes(xlValue).Select With ActiveChart.Axes(xlValue) .MinimumScale = -1 * MaxVal .MaximumScale = 0 End With LastPlace = LastPlace - 1 If Rank > 5 Then Application.EnableEvents = False FirstPlace = 1 TmpStr = "E6:E" + Trim(Str(LastPlace)) Range(TmpStr).ClearContents ScoreMax = -100000000 CalcMinMax FirstPlace, LastPlace, ScoreMax Place = 0 For j = FirstPlace To LastPlace + 1 For i = FirstPlace + 5 To LastPlace + 5 Line = Trim(Str(i)) Rank = Range("E" + Trim(Str(Line))).Value Score = Range("D" + Trim(Str(Line))).Value If Val(Rank) = 0 And Score = ScoreMax Then Place = Place + 1 If Score > 0 Then Range("E" + Trim(Str(Line))).Value = Place Exit For End If ScoreMax = -1000000000 CalcMinMax FirstPlace, LastPlace, ScoreMax Next i Next j NbrListes = ActiveWorkbook.Sheets.Count - 4 ColHit = (NbrListes - 1) * 3 + 1 Sheets(6).Activate ActiveSheet.Range(Cells(26, 10), Cells(117, 12)).Select End If Range(Position).Select Application.EnableEvents = True End Sub
bourby
Si un graphique est actif, il ne reconnait pas Activesheet ???
Cordialement
Bourby
Voici la source:
Private Sub Worksheet_SelectionChange(ByVal Target As Excel.Range) Dim MaxVal, Rank, Score As Long Dim i, j, FirstPlace, LastPlace, Col, ColHit, ScoreMax, Place, NbrListes, Line As Integer Dim Position, TmpStr As String Dim ListToSort As Range
Rank = ActiveCell.Row Position = ActiveCell.Address LastPlace = 6 NbrCandid = 1 While ActiveSheet.Cells(LastPlace, 2) <> "" LastPlace = LastPlace + 1 Wend NbrCandid = LastPlace - 6 MaxVal = Application.WorksheetFunction.Max(Range(Cells(6, 4), Cells(NbrCandid + 5, 4))) ActiveSheet.ChartObjects("Graphique 1").Activate ActiveChart.ChartArea.Select ActiveChart.Axes(xlValue).Select With ActiveChart.Axes(xlValue) .MinimumScale = -1 * MaxVal .MaximumScale = 0 End With LastPlace = LastPlace - 1 If Rank > 5 Then Application.EnableEvents = False FirstPlace = 1 TmpStr = "E6:E" + Trim(Str(LastPlace)) Range(TmpStr).ClearContents ScoreMax = -100000000 CalcMinMax FirstPlace, LastPlace, ScoreMax Place = 0 For j = FirstPlace To LastPlace + 1 For i = FirstPlace + 5 To LastPlace + 5 Line = Trim(Str(i)) Rank = Range("E" + Trim(Str(Line))).Value Score = Range("D" + Trim(Str(Line))).Value If Val(Rank) = 0 And Score = ScoreMax Then Place = Place + 1 If Score > 0 Then Range("E" + Trim(Str(Line))).Value = Place Exit For End If ScoreMax = -1000000000 CalcMinMax FirstPlace, LastPlace, ScoreMax Next i Next j NbrListes = ActiveWorkbook.Sheets.Count - 4 ColHit = (NbrListes - 1) * 3 + 1 Sheets(6).Activate ActiveSheet.Range(Cells(26, 10), Cells(117, 12)).Select End If Range(Position).Select Application.EnableEvents = True End Sub
Si un graphique est actif, il ne reconnait pas Activesheet ???
Cordialement
Bourby
Voici la source:
Private Sub Worksheet_SelectionChange(ByVal Target As Excel.Range)
Dim MaxVal, Rank, Score As Long
Dim i, j, FirstPlace, LastPlace, Col, ColHit, ScoreMax, Place,
NbrListes, Line As Integer
Dim Position, TmpStr As String
Dim ListToSort As Range
Rank = ActiveCell.Row
Position = ActiveCell.Address
LastPlace = 6
NbrCandid = 1
While ActiveSheet.Cells(LastPlace, 2) <> ""
LastPlace = LastPlace + 1
Wend
NbrCandid = LastPlace - 6
MaxVal = Application.WorksheetFunction.Max(Range(Cells(6, 4),
Cells(NbrCandid + 5, 4)))
ActiveSheet.ChartObjects("Graphique 1").Activate
ActiveChart.ChartArea.Select
ActiveChart.Axes(xlValue).Select
With ActiveChart.Axes(xlValue)
.MinimumScale = -1 * MaxVal
.MaximumScale = 0
End With
LastPlace = LastPlace - 1
If Rank > 5 Then
Application.EnableEvents = False
FirstPlace = 1
TmpStr = "E6:E" + Trim(Str(LastPlace))
Range(TmpStr).ClearContents
ScoreMax = -100000000
CalcMinMax FirstPlace, LastPlace, ScoreMax
Place = 0
For j = FirstPlace To LastPlace + 1
For i = FirstPlace + 5 To LastPlace + 5
Line = Trim(Str(i))
Rank = Range("E" + Trim(Str(Line))).Value
Score = Range("D" + Trim(Str(Line))).Value
If Val(Rank) = 0 And Score = ScoreMax Then
Place = Place + 1
If Score > 0 Then Range("E" + Trim(Str(Line))).Value = Place
Exit For
End If
ScoreMax = -1000000000
CalcMinMax FirstPlace, LastPlace, ScoreMax
Next i
Next j
NbrListes = ActiveWorkbook.Sheets.Count - 4
ColHit = (NbrListes - 1) * 3 + 1
Sheets(6).Activate
ActiveSheet.Range(Cells(26, 10), Cells(117, 12)).Select
End If
Range(Position).Select
Application.EnableEvents = True
End Sub
Si un graphique est actif, il ne reconnait pas Activesheet ???
Cordialement
Bourby
Voici la source:
Private Sub Worksheet_SelectionChange(ByVal Target As Excel.Range) Dim MaxVal, Rank, Score As Long Dim i, j, FirstPlace, LastPlace, Col, ColHit, ScoreMax, Place, NbrListes, Line As Integer Dim Position, TmpStr As String Dim ListToSort As Range
Rank = ActiveCell.Row Position = ActiveCell.Address LastPlace = 6 NbrCandid = 1 While ActiveSheet.Cells(LastPlace, 2) <> "" LastPlace = LastPlace + 1 Wend NbrCandid = LastPlace - 6 MaxVal = Application.WorksheetFunction.Max(Range(Cells(6, 4), Cells(NbrCandid + 5, 4))) ActiveSheet.ChartObjects("Graphique 1").Activate ActiveChart.ChartArea.Select ActiveChart.Axes(xlValue).Select With ActiveChart.Axes(xlValue) .MinimumScale = -1 * MaxVal .MaximumScale = 0 End With LastPlace = LastPlace - 1 If Rank > 5 Then Application.EnableEvents = False FirstPlace = 1 TmpStr = "E6:E" + Trim(Str(LastPlace)) Range(TmpStr).ClearContents ScoreMax = -100000000 CalcMinMax FirstPlace, LastPlace, ScoreMax Place = 0 For j = FirstPlace To LastPlace + 1 For i = FirstPlace + 5 To LastPlace + 5 Line = Trim(Str(i)) Rank = Range("E" + Trim(Str(Line))).Value Score = Range("D" + Trim(Str(Line))).Value If Val(Rank) = 0 And Score = ScoreMax Then Place = Place + 1 If Score > 0 Then Range("E" + Trim(Str(Line))).Value = Place Exit For End If ScoreMax = -1000000000 CalcMinMax FirstPlace, LastPlace, ScoreMax Next i Next j NbrListes = ActiveWorkbook.Sheets.Count - 4 ColHit = (NbrListes - 1) * 3 + 1 Sheets(6).Activate ActiveSheet.Range(Cells(26, 10), Cells(117, 12)).Select End If Range(Position).Select Application.EnableEvents = True End Sub
isabelle
re bonjour luc,
essai en deplacent la commande : Application.EnableEvents = True
juste après la commande : Next j
isabelle
Voici la source:
Private Sub Worksheet_SelectionChange(ByVal Target As Excel.Range) Dim MaxVal, Rank, Score As Long Dim i, j, FirstPlace, LastPlace, Col, ColHit, ScoreMax, Place, NbrListes, Line As Integer Dim Position, TmpStr As String Dim ListToSort As Range
Rank = ActiveCell.Row Position = ActiveCell.Address LastPlace = 6 NbrCandid = 1 While ActiveSheet.Cells(LastPlace, 2) <> "" LastPlace = LastPlace + 1 Wend NbrCandid = LastPlace - 6 MaxVal = Application.WorksheetFunction.Max(Range(Cells(6, 4), Cells(NbrCandid + 5, 4))) ActiveSheet.ChartObjects("Graphique 1").Activate ActiveChart.ChartArea.Select ActiveChart.Axes(xlValue).Select With ActiveChart.Axes(xlValue) .MinimumScale = -1 * MaxVal .MaximumScale = 0 End With LastPlace = LastPlace - 1 If Rank > 5 Then Application.EnableEvents = False FirstPlace = 1 TmpStr = "E6:E" + Trim(Str(LastPlace)) Range(TmpStr).ClearContents ScoreMax = -100000000 CalcMinMax FirstPlace, LastPlace, ScoreMax Place = 0 For j = FirstPlace To LastPlace + 1 For i = FirstPlace + 5 To LastPlace + 5 Line = Trim(Str(i)) Rank = Range("E" + Trim(Str(Line))).Value Score = Range("D" + Trim(Str(Line))).Value If Val(Rank) = 0 And Score = ScoreMax Then Place = Place + 1 If Score > 0 Then Range("E" + Trim(Str(Line))).Value = Place Exit For End If ScoreMax = -1000000000 CalcMinMax FirstPlace, LastPlace, ScoreMax Next i Next j NbrListes = ActiveWorkbook.Sheets.Count - 4 ColHit = (NbrListes - 1) * 3 + 1 Sheets(6).Activate ActiveSheet.Range(Cells(26, 10), Cells(117, 12)).Select End If Range(Position).Select Application.EnableEvents = True End Sub
re bonjour luc,
essai en deplacent la commande :
Application.EnableEvents = True
juste après la commande :
Next j
isabelle
Voici la source:
Private Sub Worksheet_SelectionChange(ByVal Target As Excel.Range)
Dim MaxVal, Rank, Score As Long
Dim i, j, FirstPlace, LastPlace, Col, ColHit, ScoreMax, Place,
NbrListes, Line As Integer
Dim Position, TmpStr As String
Dim ListToSort As Range
Rank = ActiveCell.Row
Position = ActiveCell.Address
LastPlace = 6
NbrCandid = 1
While ActiveSheet.Cells(LastPlace, 2) <> ""
LastPlace = LastPlace + 1
Wend
NbrCandid = LastPlace - 6
MaxVal = Application.WorksheetFunction.Max(Range(Cells(6, 4),
Cells(NbrCandid + 5, 4)))
ActiveSheet.ChartObjects("Graphique 1").Activate
ActiveChart.ChartArea.Select
ActiveChart.Axes(xlValue).Select
With ActiveChart.Axes(xlValue)
.MinimumScale = -1 * MaxVal
.MaximumScale = 0
End With
LastPlace = LastPlace - 1
If Rank > 5 Then
Application.EnableEvents = False
FirstPlace = 1
TmpStr = "E6:E" + Trim(Str(LastPlace))
Range(TmpStr).ClearContents
ScoreMax = -100000000
CalcMinMax FirstPlace, LastPlace, ScoreMax
Place = 0
For j = FirstPlace To LastPlace + 1
For i = FirstPlace + 5 To LastPlace + 5
Line = Trim(Str(i))
Rank = Range("E" + Trim(Str(Line))).Value
Score = Range("D" + Trim(Str(Line))).Value
If Val(Rank) = 0 And Score = ScoreMax Then
Place = Place + 1
If Score > 0 Then Range("E" + Trim(Str(Line))).Value = Place
Exit For
End If
ScoreMax = -1000000000
CalcMinMax FirstPlace, LastPlace, ScoreMax
Next i
Next j
NbrListes = ActiveWorkbook.Sheets.Count - 4
ColHit = (NbrListes - 1) * 3 + 1
Sheets(6).Activate
ActiveSheet.Range(Cells(26, 10), Cells(117, 12)).Select
End If
Range(Position).Select
Application.EnableEvents = True
End Sub
essai en deplacent la commande : Application.EnableEvents = True
juste après la commande : Next j
isabelle
Voici la source:
Private Sub Worksheet_SelectionChange(ByVal Target As Excel.Range) Dim MaxVal, Rank, Score As Long Dim i, j, FirstPlace, LastPlace, Col, ColHit, ScoreMax, Place, NbrListes, Line As Integer Dim Position, TmpStr As String Dim ListToSort As Range
Rank = ActiveCell.Row Position = ActiveCell.Address LastPlace = 6 NbrCandid = 1 While ActiveSheet.Cells(LastPlace, 2) <> "" LastPlace = LastPlace + 1 Wend NbrCandid = LastPlace - 6 MaxVal = Application.WorksheetFunction.Max(Range(Cells(6, 4), Cells(NbrCandid + 5, 4))) ActiveSheet.ChartObjects("Graphique 1").Activate ActiveChart.ChartArea.Select ActiveChart.Axes(xlValue).Select With ActiveChart.Axes(xlValue) .MinimumScale = -1 * MaxVal .MaximumScale = 0 End With LastPlace = LastPlace - 1 If Rank > 5 Then Application.EnableEvents = False FirstPlace = 1 TmpStr = "E6:E" + Trim(Str(LastPlace)) Range(TmpStr).ClearContents ScoreMax = -100000000 CalcMinMax FirstPlace, LastPlace, ScoreMax Place = 0 For j = FirstPlace To LastPlace + 1 For i = FirstPlace + 5 To LastPlace + 5 Line = Trim(Str(i)) Rank = Range("E" + Trim(Str(Line))).Value Score = Range("D" + Trim(Str(Line))).Value If Val(Rank) = 0 And Score = ScoreMax Then Place = Place + 1 If Score > 0 Then Range("E" + Trim(Str(Line))).Value = Place Exit For End If ScoreMax = -1000000000 CalcMinMax FirstPlace, LastPlace, ScoreMax Next i Next j NbrListes = ActiveWorkbook.Sheets.Count - 4 ColHit = (NbrListes - 1) * 3 + 1 Sheets(6).Activate ActiveSheet.Range(Cells(26, 10), Cells(117, 12)).Select End If Range(Position).Select Application.EnableEvents = True End Sub