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.

Copiar y pegar en otro libro sin sobreescribir

publicado

Estoy tratando de crear una macro para ir almacenando datos en otro libro de excel sin sobreescribir los datos. Estoy utilizando esta rutina y no lo logro. No se cual es el error. 

Sub CopiarCeldas()
 
'Definir objetos a utilizar
Dim wbDestino As Workbook, _
    wsOrigen As Excel.Worksheet, _
    wsDestino As Excel.Worksheet, _
    rngOrigen As Excel.Range, _
    rngDestino As Excel.Range
     
'Indicar el libro de Excel destino
Set wbDestino = Workbooks.Open("C:\JORGE\PEDIDOS DE QUIMICOS\DATOS.xlsx")
 
'Activar este libro
ThisWorkbook.Activate
 
'Indicar las hojas de origen y destino
Set wsOrigen = Worksheets("Analysis")
Set wsDestino = wbDestino.Worksheets("Sheet1")
 
'Indicar la celda de origen y destino
Const celdaOrigen = "A1"
Const celdaDestino = "A1"

 
'Inicializar los rangos de origen y destino
Set rngOrigen = wsOrigen.Range(celdaOrigen)
Set rngDestino = wsDestino.Range("A1").End(xlDown).Offset(1, 0)

 
'Seleccionar rango de celdas origen
rngOrigen.Select
Range(Selection, Selection.End(xlDown)).Select
Range(Selection, Selection.End(xlToRight)).Select
Selection.Copy
 
'Pegar datos en celda destino
rngDestino.PasteSpecial xlPasteAll
Application.CutCopyMode = False
 
'Guardar y cerrar el libro de Excel destino
wbDestino.Save
wbDestino.Close
 
End Sub

Featured Replies

publicado

Hola, donde te da el error. Recuerda que en el archivo origen donde esta la macro tienes que tener una hoja con nombre "analysis" y en el archivo destino una hoja con nombre "sheet1".

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.