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.

Problema excel a txt

publicado

Mi Macros transforma datos del Excel a txt separando las columnas por un palote, mi problema es que transfiere también la información de filas vacías agregando los palotes hasta el infinito.

Sub CreaTxT()

Dim NombreArchivo, RutaArchivo As String

Dim obj As FileSystemObject

Dim tx As Scripting.TextStream

Dim ht As Worksheet

Dim i, j, nfilas, ncolumnas As Integer

NombreArchivo = "LE" & Cells(2, 4).Value & Cells(3, 4) & "0008010000" & Cells(4, 5) & Cells(5, 5) & Cells(6, 5) & "1"

RutaArchivo = ActiveWorkbook.Path & "\" & NombreArchivo & ".txt"

Set obj = New FileSystemObject

Set tx = obj.CreateTextFile(RutaArchivo)

Set ht = Worksheets("REGISTRO FINAL")

nfilas = ht.Range("a6", ht.Range("a6").End(xlDown)).Cells.Count

ncolumnas = ht.Range("a5", ht.Range("a5").End(xlToRight)).Cells.Count

For i = 5 To nfilas

For j = 1 To ncolumnas

tx.Write ht.Cells(i + 1, j)

If j < ncolumnas Then tx.Write "|"

Next j

tx.WriteLine

Next i

tx.Close

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.