Ver Mensaje Individual
  #3 (permalink)  
Antiguo 24/02/2011, 09:38
marianoira77
 
Fecha de Ingreso: febrero-2011
Mensajes: 5
Antigüedad: 13 años, 2 meses
Puntos: 0
Respuesta: Funcion para asignar Caracteres a un Texto con V B

Hola, que tal !

Yo estoy ejecutando esta macro, la cual pasa de una planilla de excel a un TXT, el cual esta delimitado por tabulaciones, las cuales yo no quiero...

Hoy por hoy, estoy haciendo un reemplanzar de la tabulación por nada, para que me las pueda eliminar dentro del txt ... lo cual es muy lento y engorroso

Existe alguna función que me permita eliminar dichas tabulaciones, el codigo que estoy usando para armar el archivo es el siguiente

Sub Grabar_fichero_de_texto()
On Error Resume Next
Application.ScreenUpdating = False
ActiveSheet.Copy
Cells.Select
Selection.Copy
Selection.PasteSpecial Paste:=xlPasteValues
Range("A1").Select
Range(Selection, Selection.End(xlDown)).Select
Selection.NumberFormat = "0000000000"
Range("B1").Select
Range(Selection, Selection.End(xlDown)).Select
Selection.NumberFormat = "000000"
Range("C1").Select
Range(Selection, Selection.End(xlDown)).Select
Selection.NumberFormat = "00000000000000000000"
Range("D1").Select
Range(Selection, Selection.End(xlDown)).Select
Selection.NumberFormat = "00000"
Range("E1").Select
Range(Selection, Selection.End(xlDown)).Select
Selection.NumberFormat = "000000"
Range("F1").Select
Range(Selection, Selection.End(xlDown)).Select
Selection.NumberFormat = "00000000"
Range("G1").Select
Range(Selection, Selection.End(xlDown)).Select
Selection.NumberFormat = "00"
Range("H1").Select
Range(Selection, Selection.End(xlDown)).Select
Selection.NumberFormat = "00000000"
Range("I1").Select
Range(Selection, Selection.End(xlDown)).Select
Selection.NumberFormat = "000"
Range("J1").Select
Range(Selection, Selection.End(xlDown)).Select
Selection.NumberFormat = "0000"
Range("K1").Select
Range(Selection, Selection.End(xlDown)).Select
Selection.NumberFormat = "0000000000000"
Range("L1").Select
Range(Selection, Selection.End(xlDown)).Select
Selection.NumberFormat = "000"
Range("M1").Select
Range(Selection, Selection.End(xlDown)).Select
Selection.NumberFormat = "000"
fichero = ThisWorkbook.Name
ruta = ThisWorkbook.Path
fichero = Replace(fichero, ".xlsx", "")
fichero = Replace(fichero, ".xls", "")
ActiveSheet.Select
Application.DisplayAlerts = False
ActiveWorkbook.SaveAs Filename:=ruta & "\" & fichero & ".txt", FileFormat:=xlText
ActiveWorkbook.Close
Application.ScreenUpdating = True
End Sub



Gracias por la respuesta

Saludos

Mariano