Bonjour à tous
voila un petit probleme de macro que je n'arrive pas à résoudre car je suis trop nul
je ne comprends pas pourquoi ma macro ne s'applique pas partout sur mon fichier
ce que je vousdrai pouvoir faire en plus sur ce fichier mais que je n'arrive pas est en couleur 3 fois pour exemple mais devrai s'appliquer sur tout le fichier
je souhaiterai ensuite masquer les colonnes N O P
je sais que vous etes les meilleurs, c'est pour cela que je fais appel à vous
merci de votre aide
voici ma modeste macro et mon bout de fichier
Sub FAILS_MONITOR_GERMAN_MARKET()
Dim I As Integer
Dim code As String, debut1 As String, debut2 As String
Application.ScreenUpdating = False
Range("B:B,E:E,I:I,K:K,N:N").Select
ActiveWindow.SmallScroll ToRight:=8
Range("B:B,E:E,I:I,K:K,N:N,R:R,T:T").Select
Selection.delete Shift:=xlToLeft
' critères
For I = 2 To Range("A65536").End(xlUp).Row
If Not InStr(1, Cells(I, 4).Value, "EBBP", vbTextCompare) = 0 And IsEmpty(Cells(I, 5).Value) = True Then Cells(I, 6).Value = "POSITION EUROCLEAR"
If Not InStr(1, Cells(I, 4).Value, "EBTY", vbTextCompare) = 0 And IsEmpty(Cells(I, 5).Value) = True Then Cells(I, 6).Value = "POSITION TRIPARTY"
If Cells(I, 1).Value = "Trade" And Cells(I + 1, 1).Value = "Position" Then Rows(I + 1 & ":" & I + 1).Insert Shift:=xlDown
If Cells(I, 6).Value = "POSITION TRIPARTY" And IsEmpty(Cells(I + 1, 6)) = False Then Rows(I + 1 & ":" & I + 1).Insert Shift:=xlDown
Next I
For I = 2 To Range("A65536").End(xlUp).Row
If Cells(I, 6).Value = "POSITION EUROCLEAR" Then ActiveCell.FormulaR1C1 = "=RC[7]"
If Cells(I, 6).Value = "POSITION TRIPARTY" Then ActiveCell.FormulaR1C1 = "=RC[7]"
Range("G7").Select
Next I
'mise en gras des colonnes
Range("A:B,F:F,H:H,I:I,K:K").Font.Bold = True
'séparateur de milliers
columns("G:G").NumberFormat = "#,##0"
columns("H").NumberFormat = "#,##0.00 _€"
'centrer les celule, fond blanc
With Cells
.HorizontalAlignment = xlCenter
.VerticalAlignment = xlCenter
.Interior.ColorIndex = 2
End With
'premiere ligne plus large, en gras, et couleur de celule bleu turquoise
With Rows("1:1")
.Font.Bold = True
.RowHeight = 40
.Interior.ColorIndex = 34
End With
'zoom à 80%, ajustement automatique ligne colonne
ActiveWindow.Zoom = 80
Cells.Select
Cells.EntireColumn.AutoFit
Range("F15").Select
'mise en page, paysage, ajustée 1 page en largeur et 100 pages en longeurs, 0 marge droite gauche,
'centré vertical et horizontal, en-tete et pieds de page renseignés
With ActiveSheet.PageSetup
.Orientation = xlLandscape
.Zoom = False
.FitToPagesWide = 1
.FitToPagesTall = 100
.LeftMargin = Application.InchesToPoints(0)
.RightMargin = Application.InchesToPoints(0)
.CenterHorizontally = True
.CenterVertically = True
.CenterHeader = "&""Arial,Gras""&11 FAILS MONITOR GERMAN MARKET"
.RightHeader = "&D"
.LeftFooter = "&T"
.RightFooter = "&""Arial,Gras""&BOBY"
End With
Range("F15").Select
'zone d'impression jusqu'à la dernière ligne non vide
Dim DerLig As Integer
Dim DerCol As Integer
DerLig = Range("a65536").End(xlUp).Row
DerCol = Range("h40").End(xlToRight).Column
ActiveSheet.PageSetup.PrintArea = Range(Cells(1, 1), Cells(DerLig, DerCol)).Address
'fenetres / reorganiser / Horizontal
Windows.Arrange ArrangeStyle:=xlHorizontal
Application.ScreenUpdating = True
End Sub
voila un petit probleme de macro que je n'arrive pas à résoudre car je suis trop nul
je ne comprends pas pourquoi ma macro ne s'applique pas partout sur mon fichier
ce que je vousdrai pouvoir faire en plus sur ce fichier mais que je n'arrive pas est en couleur 3 fois pour exemple mais devrai s'appliquer sur tout le fichier
je souhaiterai ensuite masquer les colonnes N O P
je sais que vous etes les meilleurs, c'est pour cela que je fais appel à vous
merci de votre aide
voici ma modeste macro et mon bout de fichier
Sub FAILS_MONITOR_GERMAN_MARKET()
Dim I As Integer
Dim code As String, debut1 As String, debut2 As String
Application.ScreenUpdating = False
Range("B:B,E:E,I:I,K:K,N:N").Select
ActiveWindow.SmallScroll ToRight:=8
Range("B:B,E:E,I:I,K:K,N:N,R:R,T:T").Select
Selection.delete Shift:=xlToLeft
' critères
For I = 2 To Range("A65536").End(xlUp).Row
If Not InStr(1, Cells(I, 4).Value, "EBBP", vbTextCompare) = 0 And IsEmpty(Cells(I, 5).Value) = True Then Cells(I, 6).Value = "POSITION EUROCLEAR"
If Not InStr(1, Cells(I, 4).Value, "EBTY", vbTextCompare) = 0 And IsEmpty(Cells(I, 5).Value) = True Then Cells(I, 6).Value = "POSITION TRIPARTY"
If Cells(I, 1).Value = "Trade" And Cells(I + 1, 1).Value = "Position" Then Rows(I + 1 & ":" & I + 1).Insert Shift:=xlDown
If Cells(I, 6).Value = "POSITION TRIPARTY" And IsEmpty(Cells(I + 1, 6)) = False Then Rows(I + 1 & ":" & I + 1).Insert Shift:=xlDown
Next I
For I = 2 To Range("A65536").End(xlUp).Row
If Cells(I, 6).Value = "POSITION EUROCLEAR" Then ActiveCell.FormulaR1C1 = "=RC[7]"
If Cells(I, 6).Value = "POSITION TRIPARTY" Then ActiveCell.FormulaR1C1 = "=RC[7]"
Range("G7").Select
Next I
'mise en gras des colonnes
Range("A:B,F:F,H:H,I:I,K:K").Font.Bold = True
'séparateur de milliers
columns("G:G").NumberFormat = "#,##0"
columns("H").NumberFormat = "#,##0.00 _€"
'centrer les celule, fond blanc
With Cells
.HorizontalAlignment = xlCenter
.VerticalAlignment = xlCenter
.Interior.ColorIndex = 2
End With
'premiere ligne plus large, en gras, et couleur de celule bleu turquoise
With Rows("1:1")
.Font.Bold = True
.RowHeight = 40
.Interior.ColorIndex = 34
End With
'zoom à 80%, ajustement automatique ligne colonne
ActiveWindow.Zoom = 80
Cells.Select
Cells.EntireColumn.AutoFit
Range("F15").Select
'mise en page, paysage, ajustée 1 page en largeur et 100 pages en longeurs, 0 marge droite gauche,
'centré vertical et horizontal, en-tete et pieds de page renseignés
With ActiveSheet.PageSetup
.Orientation = xlLandscape
.Zoom = False
.FitToPagesWide = 1
.FitToPagesTall = 100
.LeftMargin = Application.InchesToPoints(0)
.RightMargin = Application.InchesToPoints(0)
.CenterHorizontally = True
.CenterVertically = True
.CenterHeader = "&""Arial,Gras""&11 FAILS MONITOR GERMAN MARKET"
.RightHeader = "&D"
.LeftFooter = "&T"
.RightFooter = "&""Arial,Gras""&BOBY"
End With
Range("F15").Select
'zone d'impression jusqu'à la dernière ligne non vide
Dim DerLig As Integer
Dim DerCol As Integer
DerLig = Range("a65536").End(xlUp).Row
DerCol = Range("h40").End(xlToRight).Column
ActiveSheet.PageSetup.PrintArea = Range(Cells(1, 1), Cells(DerLig, DerCol)).Address
'fenetres / reorganiser / Horizontal
Windows.Arrange ArrangeStyle:=xlHorizontal
Application.ScreenUpdating = True
End Sub