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.

Cerrar libros que abre un loop

publicado

Hola Amigos

Investigando en la Web y con la primera ayuda de este foro finalmente logré escribir 
el código (que necesito) dentro de un Loop While. Sin embargo, no he podido escribir despés de
Application.CutCopyMode = False, la instrucción que cierre el primer libro y siguientes que abrirá el Loop cada vez que corre el Código.
Abajo incluyo las primeras líneas del Código. En la 

Con la instrucción termino el Código que he estado escribiendo. Una vez que lo pruebe, lo compartiré en el Foro

Agradezco la ayuda.

Sub importador()
Dim myfolder As String, myfile As String
Dim destination As Worksheet

'destination = ThisWorkbook.Sheets("Sheet1")
Set destination = Sheet1
myfolder = "D:\ABC\data"
myfile = Dir(myfolder & "\*xl*")

Do While myfile <> ""
	Workbooks.Open Filename:=myfolder & "\" & myfile 'Abre el primer archivo xls
	Range("A1:DS2").Select 
	Selection.Copy
    	Application.Left = 721.75
    	Application.Top = 61.75
    
    	Windows("importador.xlsm").Activate ‘Este es el libro que corre el código. ¿Hay otra instrucción para llamarlo?
    	ActiveSheet.Paste
    	Range("A1").Select
    	Application.CutCopyMode = False
  
 'Aquí necesito una instrucción para cerrar cada libro Excel que abre el loop

	Sheets(Hoja1).Select
	.
	.
	.
	.
	.
End Loop

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.