Staple1600
XLDnaute Barbatruc
Bonjour à tous
Confiné, pour confiné, confinons carrément en couleurs 😉
Ce fil prends sa source dans Lien supprimé initié par clemendo51.
Il a juste vocation à éviter d'encombrer le fil initial
A vos crayons de couleurs 😉
Digressons, digressons dans nos petits modules. 😉
Suite de là où je m'étais arrêté dans l'autre fil.
Je change mon fusil d'épaule sur ce coup là 😉
Confiné, pour confiné, confinons carrément en couleurs 😉
Ce fil prends sa source dans Lien supprimé initié par clemendo51.
Il a juste vocation à éviter d'encombrer le fil initial
A vos crayons de couleurs 😉
Digressons, digressons dans nos petits modules. 😉
Suite de là où je m'étais arrêté dans l'autre fil.
Je change mon fusil d'épaule sur ce coup là 😉
VB:
Const Umma As String = "A:A,C:C,E:E,G:G,I:I"
Const Gumma As String = "1:1,3:3,5:5,7:7,9:9"
Sub O_My_Grid()
Dim R As Range: Set R = [A1:I9]: R.ColumnWidth = 4: R.RowHeight = [A1].Width: R.Interior.Color = vbBlue
With Intersect(Range(Umma).EntireColumn, Range(Gumma).EntireRow): .Interior.Color = 255: End With
End Sub
VB:
Sub Not_X_Cross()
Dim R As Range, Tb(1 To 9, 1 To 9), i%, j%: Set R = Range("A1:I9")
For i = LBound(Tb, 1) To UBound(Tb, 1): For j = LBound(Tb, 2) To UBound(Tb, 2): Tb(i, j) = i * j Mod 5: Next j: Next i
With R
.ColumnWidth = 4: .RowHeight = .Item(1).Width: .Value = Tb
.FormatConditions.Add xlCellValue, xlEqual, Formula1:="=0"
With .FormatConditions(1): .Interior.Color = 255: .Font.Color = 255: End With
.FormatConditions.Add xlCellValue, xlGreater, Formula1:="=0"
With .FormatConditions(2): .Interior.Color = vbBlue: .Font.Color = vbBlue: End With
End With
End Sub
VB:
Sub carré_avec_des_endives() ' effet collatéral du Grand Confinement du 2020
With Cells(1).Resize(9, 9): .ColumnWidth = .ColumnWidth / (.Item(1).Width / .Item(1).Height): End With
End Sub
VB:
Sub Red_Diago()
Dim R As Range, Tb, vMFC, i&, j&, k&: Cells.Delete: Set R = Range("A1:I9"): R.Clear: R.Value = 0: Tb = R.Value
vMFC = Array(Array(6, vbYellow), Array(3, 255), Array(5, vbGreen))
For i = LBound(Tb, 1) To UBound(Tb, 1): For j = LBound(Tb, 2) To UBound(Tb, 2): Tb(i, j) = i Mod 10 - j: Next j: Next i
R.Value = Tb: R.ColumnWidth = 4: R.RowHeight = [a1].Width
For k = 0 To 2: R.FormatConditions.Add 1, vMFC(k)(0), "=0"
With R.FormatConditions(k + 1): .Font.Color = vMFC(k)(1): .Interior.Color = vMFC(k)(1): End With
Next
End Sub
VB:
Sub Blue_Line()
Dim R As Range: Cells.Delete: Set R = [A1:I9]: R.Value = [=MUNIT(9)]: R.ColumnWidth = 4: R.RowHeight = [a1].Width
R.FormatConditions.Add 1, 3, "=0": R.FormatConditions.Add 1, 5, "=0"
With R.FormatConditions(1): .Interior.Color = 255: .Font.Color = 255: End With
With R.FormatConditions(2): .Interior.Color = vbBlue: .Font.Color = vbBlue: End With
End Sub
Dernière édition: