Macro excel bug
Menator
-
Utilisateur anonyme -
Utilisateur anonyme -
Le probleme survient où j'ai mis la flèche
Private Sub CommandButton2_Click()
Rows("1:400").Select
Selection.Delete Shift:=xlUp
Dim Ligne, Nombre As Long, r As Long
Application.ScreenUpdating = False
For Nombre = Sheets.Count To 2 Step -1
Ligne = Range("a65536").End(xlUp).Row + 1
Sheets(Nombre).Range("a1:" & Sheets(Nombre).Range("a1").SpecialCells(xlCellTypeLastCell).Address).Copy
Sheets(1).Activate
Range("A" & Ligne).Select
ActiveSheet.Paste
Next Nombre
Range("S65536").End(xlUp).Offset(-9, 1) = "9"
i = 12
Do Until Range("T" & i).Value = "9"
Select Case Range("T" & i).Value
Case "a"
i = i + 1
Case Else
Rows(i).Delete
End Select
Loop
Range("t65536").End(xlUp) = ""
ActiveSheet.PageSetup.PrintArea = Range("A1:S" & _
Range("S65536").End(xlUp).Row).Address
Range("S65536").End(xlUp).Offset(-4, 0) = "= TODAY()"
i = Range("K65536").End(xlUp).Row
Columns("B:B").Insert Shift:=xlToRight
Range("B11").FormulaR1C1 = "# Par mel."
Range("B12").FormulaR1C1 = "A - 1"
Range("B12").Select
---> Selection.AutoFill Destination:=ActiveSheet.Range("B12:B" & r), Type:=xlFillDefault
Range("B12:B" & r).Select
Columns("B:B").Select
Selection.ColumnWidth = 8.71
Range("B10:B11").Select
Range("B11").Activate
With Selection
.HorizontalAlignment = xlCenter
.VerticalAlignment = xlCenter
.WrapText = False
.Orientation = 0
.AddIndent = False
.IndentLevel = 0
.ShrinkToFit = False
.ReadingOrder = xlContext
.MergeCells = False
End With
Selection.Merge
End Sub
Private Sub CommandButton2_Click()
Rows("1:400").Select
Selection.Delete Shift:=xlUp
Dim Ligne, Nombre As Long, r As Long
Application.ScreenUpdating = False
For Nombre = Sheets.Count To 2 Step -1
Ligne = Range("a65536").End(xlUp).Row + 1
Sheets(Nombre).Range("a1:" & Sheets(Nombre).Range("a1").SpecialCells(xlCellTypeLastCell).Address).Copy
Sheets(1).Activate
Range("A" & Ligne).Select
ActiveSheet.Paste
Next Nombre
Range("S65536").End(xlUp).Offset(-9, 1) = "9"
i = 12
Do Until Range("T" & i).Value = "9"
Select Case Range("T" & i).Value
Case "a"
i = i + 1
Case Else
Rows(i).Delete
End Select
Loop
Range("t65536").End(xlUp) = ""
ActiveSheet.PageSetup.PrintArea = Range("A1:S" & _
Range("S65536").End(xlUp).Row).Address
Range("S65536").End(xlUp).Offset(-4, 0) = "= TODAY()"
i = Range("K65536").End(xlUp).Row
Columns("B:B").Insert Shift:=xlToRight
Range("B11").FormulaR1C1 = "# Par mel."
Range("B12").FormulaR1C1 = "A - 1"
Range("B12").Select
---> Selection.AutoFill Destination:=ActiveSheet.Range("B12:B" & r), Type:=xlFillDefault
Range("B12:B" & r).Select
Columns("B:B").Select
Selection.ColumnWidth = 8.71
Range("B10:B11").Select
Range("B11").Activate
With Selection
.HorizontalAlignment = xlCenter
.VerticalAlignment = xlCenter
.WrapText = False
.Orientation = 0
.AddIndent = False
.IndentLevel = 0
.ShrinkToFit = False
.ReadingOrder = xlContext
.MergeCells = False
End With
Selection.Merge
End Sub
A voir également:
- Macro excel bug
- Telecharger macro convertir chiffre en lettre excel - Télécharger - Tableur
- Liste déroulante excel - Guide
- Word et excel gratuit - Guide
- Si ou excel - Guide
- Bug chromecast - Guide
2 réponses
Bonjour,
Bien que la variable [ r ] soit dimensionné, elle n'est pas initialisé.
Aucune valeur ne lui est affecté ?
Cdt
Lupin
Bien que la variable [ r ] soit dimensionné, elle n'est pas initialisé.
Aucune valeur ne lui est affecté ?
Cdt
Lupin
re:
le feuille active, ou le feuille cible est difficile à localiser
n'ayant pas les données ...
je te recommande les mots clés
Option Explicit
en début de module et l'utilisation de la propriété
Select des feuilles lors des traitements.
ça ne t'aide pas beaucoup, mais peut-être qu'un
autre pourra aller plus loin :-)
Cdt
Lupin
le feuille active, ou le feuille cible est difficile à localiser
n'ayant pas les données ...
je te recommande les mots clés
Option Explicit
en début de module et l'utilisation de la propriété
Select des feuilles lors des traitements.
ça ne t'aide pas beaucoup, mais peut-être qu'un
autre pourra aller plus loin :-)
Cdt
Lupin
Selection.Delete Shift:=xlUp
Dim Ligne, Nombre As Long, r As Long
Application.ScreenUpdating = False
For Nombre = Sheets.Count To 2 Step -1
Ligne = Range("a65536").End(xlUp).Row + 1
Sheets(Nombre).Range("a1:" & Sheets(Nombre).Range("a1").SpecialCells(xlCellTypeLastCell).Address).Copy
Sheets(1).Activate
Range("A" & Ligne).Select
ActiveSheet.Paste
Next Nombre
Range("S65536").End(xlUp).Offset(-9, 1) = "9"
i = 12
Do Until Range("T" & i).Value = "9"
Select Case Range("T" & i).Value
Case "a"
i = i + 1
Case Else
Rows(i).Delete
End Select
Loop
Range("t65536").End(xlUp) = ""
ActiveSheet.PageSetup.PrintArea = Range("A1:S" & _
Range("S65536").End(xlUp).Row).Address
Range("S65536").End(xlUp).Offset(-4, 0) = "= TODAY()"
i = Range("K65536").End(xlUp).Row
-------> Columns("B:B").Insert Shift:=xlToRight
Range("B11").FormulaR1C1 = "# Par mel."
Range("B12").FormulaR1C1 = "A - 1"
Range("B12").Select
Selection.AutoFill Destination:=ActiveSheet.Range("B12:B" & i), Type:=xlFillDefault
Range("B12:B" & i).Select
Columns("B:B").Select
Selection.ColumnWidth = 8.71
Range("B10:B11").Select
Range("B11").Activate
With Selection
.HorizontalAlignment = xlCenter
.VerticalAlignment = xlCenter
.WrapText = False
.Orientation = 0
.AddIndent = False
.IndentLevel = 0
.ShrinkToFit = False
.ReadingOrder = xlContext
.MergeCells = False
End With
Selection.Merge
End Sub
Oups, j'avais oublier de modifier mon r, mais ca ne marche toujours pas, maintenant il me mais un bog où j'ai mis la flèche.
Si j'enleve tout se qui se trouve après TODAY ca marche nickel........ J'ai pas Dim le i.... aurais-je du..........J'ai essayer de plusieurs maniere et aucune fonctionne .....j'ai perdu ma journée la dessus please help !!!