Alguem pode me ajudar?
Preciso substituir uma coluna de Letra por uma coluna com Numeros (20000 linhas). Veja abaixo. O que está na coluna A deve ser substituido pelo o que está na coluna B.
Coluna A Coluna B
ENE 67,5
SSE 157,5
E 90
NNE 22,5
Estou usando a seguinte macro, mas onde tem E ele substitui por 90 e no restante ele coloca zero!
NNE 90
ENE 90090
Segue abaixo a macro utilizada:
Sub substituir()
Dim lngRow As Long
Dim rng As Range
Dim lngLast As Long
Dim wksSubstituir As Worksheet
Set wksSubstituir = ThisWorkbook.Worksheets("substituir")
Set rng = Intersect(Selection, ActiveSheet.UsedRange)
With wksSubstituir
'Configuração da caixa de pesquisa:
wksSubstituir.Range("A1").Replace What:="substituir" _
, Replacement:="substituir" _
, LookAt:=xlPart _
, SearchOrder:=xlByRows _
, MatchCase:=False _
, SearchFormat:=False _
, ReplaceFormat:=False
lngLast = .Cells(.Rows.Count, "A").End(xlUp).Row
For lngRow = 1 To lngLast
rng.Replace What:=.Cells(lngRow, "A") _
, Replacement:=.Cells(lngRow, "B")
Next lngRow
End With
End Sub