Execute a função “MilagreDivino” no editor de Visual Basic para Excel.
A função deve remover todos os caracteres científicos de uma planilha Excel.
Sub MilagreDivino() Dim xColunas As Integer Dim PararAgora As Boolean xColunas = 2 Do While Not PararAgora If Trim("" & Cells(1, xColunas)) <> "" Then Dim Coluna Coluna = ToColletter(xColunas) If InStr(Range(ToColletter(xColunas - 1) & "1").NumberFormat, "yyyy-mm-dd") <> 1 Then Range(Coluna & ":" & Coluna).Select Selection.Insert Shift:=xlToRight, CopyOrigin:=xlFormatFromLeftOrAbove Range(Coluna & "1").Select ActiveCell.FormulaR1C1 = "=TRIM(RC[-1])" Range(Coluna & "1").Select Selection.AutoFill Destination:=Range(Coluna & "1:" & Coluna & "4125") Range(Coluna & "1:" & Coluna & "4125").Select Selection.Copy Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _ :=False, Transpose:=False Coluna = ToColletter(xColunas - 1) Range(Coluna & ":" & Coluna).Select Application.CutCopyMode = False Selection.Delete Shift:=xlToLeft End If Else PararAgora = True End If xColunas = xColunas + 1 Loop End Sub Public Function ToColletter(Collet) ToColletter = Split(Cells(1, Collet).Address, "$")(1) End Function
Categorias:Programação
Deixe uma resposta