Sub ConvertirDatos() Dim ws As Worksheet Set ws = Sheets("Sheet1") ' Crear duplicado de la hoja "Sheet1" ws.Copy After:=ws Set ws = ActiveSheet ws.Visible = xlSheetHidden Sheets("Sheet1").Activate Set ws = Sheets("Sheet1") ' siempre se queda en la hoja original With Sheets("Sheet1") .Rows(1).Delete .Columns("E:G").Delete End With Dim lastRow As Long lastRow = ws.Cells(ws.Rows.Count, "B").End(xlUp).Row Dim i As Long For i = 2 To lastRow Dim codigo As String ' Obtener código sin error si no hay guion If InStr(ws.Cells(i, 2).Value, "-") > 0 Then codigo = Trim(Split(ws.Cells(i, 2).Value, "-")(0)) Else codigo = Trim(ws.Cells(i, 2).Value) End If ' Notas de crédito: 203, 21, 3 ? cambiar signo en columnas L a Q If codigo = "203" Or codigo = "21" Or codigo = "3" Then Dim j As Long For j = 9 To 14 ' Columnas L a Q If IsNumeric(ws.Cells(i, j).Value) And ws.Cells(i, j).Value <> "" Then ws.Cells(i, j).Value = CDbl(ws.Cells(i, j).Value) * -1 End If Next j ' Factura de exportación: 19 ? calcular pesos (J * Q) y guardar en R ElseIf codigo = "19" Then If IsNumeric(ws.Cells(i, 7).Value) And IsNumeric(ws.Cells(i, 14).Value) Then ws.Cells(i, 15).Value = CDbl(ws.Cells(i, 7).Value) * CDbl(ws.Cells(i, 14).Value) End If End If Next i ' Aplicar formato argentino a columnas I a O Columns("I:O").Select Selection.NumberFormat = "#,##0.00" ws.Columns("A").TextToColumns Destination:=ws.Range("A1"), DataType:=xlDelimited, TextQualifier:=xlDoubleQuote, ConsecutiveDelimiter:=False, Tab:=False, Semicolon:=False, Comma:=False, Space:=False, Other:=False, FieldInfo:=Array(1, 4) End Sub