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.

Importar archivo CSV y darle formato de tabla dinamica

publicado

Que tal a todos hoy tengo un problema estoy trabajando en una serie de macros para generar reportes de empleados por hr, estos datos los obtienen de una app externa la cual exporta un archivo CSV

lo que necesito es importar este archivo csv y darle formato de tabla dinamica, consecutivamente la info ira creciendo y mi problema es que no se como darle el formato de tabla dinamica utilizando VBA ya consegui importarlo esperen me puedan ayudar u orientar gracias

 

Les dejo mi codigo para importar archivos CSV igual les sirve....

 

Sub import()
 
 Dim t As Single
    t = Timer
    Sheets("Hoja1").Cells.ClearContents
    strFile = Application.GetOpenFilename("CSV, *.csv")
        If strFile = Empty Then
           Response = MsgBox("Ningún fichero seleccionado", _
           vbOKOnly, "Error")
        Exit Sub
        Else
        End If

    With Sheets("Hoja1").QueryTables.Add(Connection:= _
        "TEXT;" & strFile _
        , Destination:=Sheets("Hoja1").Range("$A$1"))
        .Name = "fichero"
        .FieldNames = True
        .RowNumbers = False
        .FillAdjacentFormulas = False
        .PreserveFormatting = True
        .RefreshOnFileOpen = False
        .RefreshStyle = xlInsertDeleteCells
        .SavePassword = False
        .SaveData = True
        .AdjustColumnWidth = True
        .RefreshPeriod = 0
        .TextFilePromptOnRefresh = False
        .TextFilePlatform = 850
        .TextFileStartRow = 1
        .TextFileParseType = xlDelimited
        .TextFileTextQualifier = xlTextQualifierDoubleQuote
        .TextFileConsecutiveDelimiter = False
        .TextFileTabDelimiter = True
        .TextFileSemicolonDelimiter = False 'CSV: punto y coma
        .TextFileCommaDelimiter = True
        .TextFileSpaceDelimiter = False
        .TextFileColumnDataTypes = Array(1, 1, 1, 1, 1) '5 columnas
        .TextFileTrailingMinusNumbers = True
        .Refresh BackgroundQuery:=False
    End With
 MsgBox "Importado con exito"


End Sub

 

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.