Reste les satanées colonne à mettre en majuscule
ci dessous donc la macro que j'ai réussi en rajoutant des morceaux d'autres macros... à obtenir ce que je voulais mais maintenant c'est les majuscules sur colonne et Première lettre majuscule sur d'autres colonnes que je n'arrive pas à mettre ça pas possible de bidouiller !! si quelqu'un pouvait me rajouter ces deux options sur ma macro .
mettre en Majuscule la colonne C,L,M
mettre en 1er lettre Majuscule la colonne de D à K
Sub mise_forme_tab()
'
' mise_forme_tab Macro
'
'
ActiveWindow.SmallScroll ToRight:=6
Columns("H:H").Select
Selection.Insert Shift:=xlToRight, CopyOrigin:=xlFormatFromLeftOrAbove
Selection.Insert Shift:=xlToRight, CopyOrigin:=xlFormatFromLeftOrAbove
Selection.Insert Shift:=xlToRight, CopyOrigin:=xlFormatFromLeftOrAbove
ActiveWindow.SmallScroll ToRight:=2
ActiveWindow.ScrollColumn = 8
ActiveWindow.ScrollColumn = 9
ActiveWindow.SmallScroll ToRight:=-2
Columns("G:G").Select
Selection.TextToColumns Destination:=Range("G1"), DataType:=xlDelimited, _
TextQualifier:=xlNone, ConsecutiveDelimiter:=False, Tab:=False, _
Semicolon:=False, Comma:=False, Space:=False, Other:=True, OtherChar _
:="&", FieldInfo:=Array(1, 1), TrailingMinusNumbers:=True
ActiveWindow.SmallScroll ToRight:=2
Columns("A:A").Select
Selection.Insert Shift:=xlToRight, CopyOrigin:=xlFormatFromLeftOrAbove
Range("A1").Select
ActiveCell.FormulaR1C1 = "Num"
Range("H1").Select
ActiveCell.FormulaR1C1 = "Rue 1"
Range("I1").Select
ActiveCell.FormulaR1C1 = "Rue 2"
Range("J1").Select
ActiveCell.FormulaR1C1 = "Rue 3"
Range("K1").Select
ActiveCell.FormulaR1C1 = "Rue 4"
Range("J21").Select
Range("A1:U1").Select
Selection.Font.Bold = True
With Selection
.HorizontalAlignment = xlCenter
.VerticalAlignment = xlBottom
.WrapText = False
.Orientation = 0
.AddIndent = False
.IndentLevel = 0
.ShrinkToFit = False
.ReadingOrder = xlContext
.MergeCells = False
End With
Columns("A:U").EntireColumn.AutoFit
Columns("F:F").Select
Selection.ColumnWidth = 35
With Selection
.VerticalAlignment = xlBottom
.WrapText = True
.Orientation = 0
.AddIndent = False
.IndentLevel = 0
.ShrinkToFit = False
.ReadingOrder = xlContext
.MergeCells = False
End With
Columns("G:G").Select
Selection.ColumnWidth = 35
With Selection
.VerticalAlignment = xlBottom
.WrapText = True
.Orientation = 0
.AddIndent = False
.IndentLevel = 0
.ShrinkToFit = False
.ReadingOrder = xlContext
.MergeCells = False
End With
ActiveWindow.SmallScroll ToRight:=10
Columns("L:L").Select
Selection.NumberFormat = "00000"
Columns("O:R").Select
With Selection
.HorizontalAlignment = xlRight
.VerticalAlignment = xlBottom
.WrapText = False
.Orientation = 0
.AddIndent = False
.IndentLevel = 0
.ShrinkToFit = False
.ReadingOrder = xlContext
.MergeCells = False
End With
Range("A1:U300").Select
Selection.Borders(xlDiagonalDown).LineStyle = xlNone
Selection.Borders(xlDiagonalUp).LineStyle = xlNone
With Selection.Borders(xlEdgeLeft)
.LineStyle = xlContinuous
.ColorIndex = 0
.TintAndShade = 0
.Weight = xlThin
End With
With Selection.Borders(xlEdgeTop)
.LineStyle = xlContinuous
.ColorIndex = 0
.TintAndShade = 0
.Weight = xlThin
End With
With Selection.Borders(xlEdgeBottom)
.LineStyle = xlContinuous
.ColorIndex = 0
.TintAndShade = 0
.Weight = xlThin
End With
With Selection.Borders(xlEdgeRight)
.LineStyle = xlContinuous
.ColorIndex = 0
.TintAndShade = 0
.Weight = xlThin
End With
With Selection.Borders(xlInsideVertical)
.LineStyle = xlContinuous
.ColorIndex = 0
.TintAndShade = 0
.Weight = xlThin
End With
With Selection.Borders(xlInsideHorizontal)
.LineStyle = xlContinuous
.ColorIndex = 0
.TintAndShade = 0
.Weight = xlThin
End With
ActiveWorkbook.Worksheets("Feuil1").Sort.SortFields.Clear
ActiveWorkbook.Worksheets("Feuil1").Sort.SortFields.Add Key:=Range("D2
781") _
, SortOn:=xlSortOnValues, Order:=xlAscending, DataOption:=xlSortNormal
ActiveWorkbook.Worksheets("Feuil1").Sort.SortFields.Add Key:=Range("E2:E781") _
, SortOn:=xlSortOnValues, Order:=xlAscending, DataOption:=xlSortNormal
With ActiveWorkbook.Worksheets("Feuil1").Sort
.SetRange Range("A1:U781")
.Header = xlYes
.MatchCase = False
.Orientation = xlTopToBottom
.SortMethod = xlPinYin
.Apply
End With
Range("A2").Select
ActiveCell.FormulaR1C1 = "1"
Range("A2").Select
Selection.AutoFill Destination:=Range("A2:A428"), Type:=xlFillSeries
Range("A2:A300").Select
Range("A2").Select
ActiveWindow.SmallScroll Down:=-18
For Each ligne In ActiveSheet.UsedRange.Rows
If ligne.Cells(1, 12).Value = Empty Then
'si la cellule de la colonne L est vide, la ligne est masquée
ligne.EntireRow.Hidden = True
End If
Next
Range("A2").Select
End Sub