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.

Duda trasponer datos con macro

publicado

Buenas,
Tengo un fichero con una hoja "INICIO", que tengo que transformar en lo que figura en hoja "FIN". No se me ocurre cómo hacerlo con macro. En el ejemplo os he puesto  3 fechas. Vienen en horizontal: fecha y luego las horas hasta 24 con su concepto. Tengo que trasponerlo y dejarlo como en hoja FIN. La parte de copiar y trasponer bien, pero no se me ocurre cómo añadir la fecha esas 24 veces en la primera columna hacia abajo por tantas fechas como existan en hoja INICIO. ¿Alguna idea? Gracias de antemano.

EJ_FECHAS.zip

Featured Replies

publicado
Sub TransponerFilas()
Dim Inicio As Worksheet, Fin As Worksheet
Application.EnableEvents = False
'--
Set Inicio = Sheets("Inicio")
Set Fin = Sheets("Fin")
'--
Fin.Range("A1").CurrentRegion.Offset(1).ClearContents
fila = 1
For x = 2 To Inicio.Range("A" & Rows.Count).End(xlUp).Row
   For y = 2 To Inicio.Cells(1, Columns.Count).End(xlToLeft).Column
      If Not Inicio.Cells(1, y) = "" Then
         fila = fila + 1
         Fin.Range("A" & fila) = Inicio.Range("A" & x)
         Fin.Range("B" & fila) = Inicio.Cells(1, y)
         Fin.Range("C" & fila) = Inicio.Cells(x, y)
      End If
   Next
Next
End Sub

 

publicado
  • Autor

Clavado, Antoni! Muchas gracias por la ayuda!

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.