1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31
| Sub texte()
Application.ScreenUpdating = False
Calcul = Application.Calculation
Application.Calculation = xlCalculationManual
Dim c As Range, MonText As String
If Selection.Cells.Count > 1 Then
Set MaSelection = Intersect(Selection.SpecialCells(xlCellTypeVisible), Range("A1", ActiveSheet.UsedRange))
Else
Set MaSelection = Selection
End If
If MaSelection.Areas.Count = 1 And MaSelection.Columns.Count = 1 Then
MaSelection.TextToColumns Destination:=MaSelection, DataType:=xlDelimited, _
TextQualifier:=xlSingleQuote, ConsecutiveDelimiter:=False, Tab:=False, _
Semicolon:=False, Comma:=False, Space:=False, Other:=False, FieldInfo _
:=Array(1, 2), TrailingMinusNumbers:=True
Else
For Each c In MaSelection
If Not c.HasFormula Then
c.NumberFormat = "@"
If Left(c.FormulaR1C1, 1) = "'" Then
MonText = Right(c.FormulaR1C1, Len(c.FormulaR1C1) - 1)
Else: MonText = c.FormulaR1C1
End If
c.Value = MonText
End If
MonText = ""
Next c
End If
Application.Calculation = Calcul
End Sub |
Partager