Saltar al contenido
View in the app

A better way to browse. Learn more.

Ayuda Excel

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Crear csv delimitado por pipeline

publicado

Buenos días,

actualmente uso una macro a diario que me genera un archivo CSV de varias hojas de un mismo libro. Como bien indica el tipo de archivo que se genera, los campos resultantes, lo hacen separado por comas, pero para la aplicación final en la que doy uso al archivo CSV generado, necesito de "|" (pipeline) para funcionar correctamente.

Copio la macro en cuestión por si es posible modificar o añadir algo que permita que el separador sea Pipeline:

Sub Crear_CSV()

Dim csvName$, mySh As Worksheet

Dim i&

Application.ScreenUpdating = False

Do

i = 1 + i

csvName$ = ThisWorkbook.Path & "\ARCHIVOCSV_" & Format(i, "0000") & ".csv"

Loop Until Dir(csvName$) = ""

Workbooks.Add xlWBATWorksheet

For Each mySh In ThisWorkbook.Sheets

mySh.[a1].CurrentRegion.Offset(1).Copy

Cells(Rows.Count, "a").End(xlUp).Offset(1).PasteSpecial xlPasteValuesAndNumberFormats

Next mySh

Rows(1).Delete

With Application

.UseSystemSeparators = False

.DecimalSeparator = "."

.ThousandsSeparator = ","

End With

ActiveWorkbook.SaveAs Filename:=csvName$, FileFormat:=xlCSVMSDOS

ActiveWorkbook.Close False

Application.UseSystemSeparators = True

Application.ScreenUpdating = True

MsgBox "Se ha creado el archivo:" & vbLf & csvName$, vbInformation, "Crear CSV"

Shell "explorer.exe /select," & csvName, vbMaximizedFocus

End Sub

Gracias por adelantado por vuestra ayuda.

Marcos.

Featured Replies

No hay posts para mostrar

Archivado

Este tema está ahora archivado y está cerrado a más respuestas.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.