Macro de Excel para txt terminar sem "|"
Enviado: 21 Ago 2018 às 10:11
Tenho uma macro para isso, só que preciso tirar a opção de terminar sem "|", como posso fazer? Segue a Macro:
Código: Selecionar todos
ExpExcelTxT()
Dim SrcRg As Range
Dim CurrRow As Range
Dim CurrCell As Range
Dim CurrTextStr As String
Dim ListSep As String
Dim DataTextStr As String
ListSep = "|"
Set SrcRg = ActiveSheet.UsedRange
Open "C:\Users\Carlos André\Desktop\ArqExp.txt" For Output As #1
For Each CurrRow In SrcRg.Rows
CurrTextStr = ""
For Each CurrCell In CurrRow.Cells
CurrTextStr = CurrTextStr & CurrCell.Value & ListSep
Next
While Right(CurrTextStr, 1) = ListSep
CurrTextStr = Left(CurrTextStr, Len(CurrTextStr) - 1)
Wend
CurrTextStr = CurrTextStr & ListSep
Print #1, CurrTextStr
Next
Close #1
End Sub