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.

Insertar filas en varias hojas de excel del mismo libro

publicado

Hola buenas, @Haplox

Mi problema es este:

- Quiero filas en varias  hojas Excel a la vez. Insertándola siempre desde la hoja1.

- Que la fila en blanco que se inserte esté en el mismo numero de fila en todas las hojas. Es decir que si inserto una fila en Hoja1 en la fila 12, en las hojas2 y hoja3 también se inserte en la fila 12.

 

He probado con este código que le dejaste a otro usuario pero me surge el problema de que si la fila que inserto en la hoja1 es la 12, en las demás hojas se me inserta en la fila 13, es decir, una por debajo. ¿Alguien sabe el problema del código?

Public Filas As Long
Public seleccion As Range

Private Sub Worksheet_Change(ByVal Target As Range)

If Filas < Me.UsedRange.Rows.Count Then
    For i = 2 To Sheets.Count
        Sheets(i).Activate
        fila = seleccion.Address
        ActiveSheet.Range(fila).EntireRow.Insert
    Next i
End If
End Sub

Private Sub Worksheet_SelectionChange(ByVal Target As Range)

If Intersect(Target, Range("1:10000")) Is Nothing Then
Exit Sub
End If

Filas = Me.UsedRange.Rows.Count
Set seleccion = Target.Cells.Rows
End Sub

Featured Replies

publicado
Hace 4 horas, Julia Mellado dijo:

He probado con este código que le dejaste a otro usuario

Uff... ni me acuerdo de ese codigo :blink:

Mejor sube tu archivo para poder verlo

publicado

Buenas! Gracias por responder tan rapido! He subido un archivo de ejemplo, al insertar una fila en la hoja 1, se inserta tambien automaticamente en la hoja2, pero una fila por debajo, en lugar de en ambas hojas el mismo numero de fila...

Muchas gracias!

Libro1.xlsm

publicado

Hola @Haplox !

publicado
Hace 13 horas, Julia Mellado dijo:

Hola @Haplox !

Impaciente... ;). Solo te hacía falta modificar un poco el código que ya tenías


 

Private Sub Worksheet_Change(ByVal Target As Range)

If Filas < Me.UsedRange.Rows.Count Then
    fila = Target.Address
    For i = 2 To Sheets.Count
        Sheets(i).Activate
        ActiveSheet.Range(fila).EntireRow.Insert
    Next i
End If
End Sub

 

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.