Ver Mensaje Individual
  #7 (permalink)  
Antiguo 07/10/2011, 12:17
exorton
 
Fecha de Ingreso: marzo-2009
Mensajes: 41
Antigüedad: 15 años, 2 meses
Puntos: 1
Respuesta: tengo problema con esta macro

ya lo hice a mi manera.

Código vb:
Ver original
  1. Application.ScreenUpdating = False
  2. hojas = Application.Sheets.Count - 5
  3.  
  4. Sheets("Hoja4").Range("B2").Select
  5.  
  6. For i = 1 To hojas
  7.     Sheets(i).Select
  8.     Range("D9").Select
  9.     Range(Selection, Selection.End(xlDown)).Select
  10.     Range(Selection, Selection.Cells(1, 7)).Select
  11.     Selection.Copy
  12.    
  13.     Rw = Selection.Rows.Count
  14.    
  15.     Sheets("Hoja4").Select
  16.     Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
  17.         :=False, Transpose:=False
  18.    
  19.    
  20.     For a = 1 To Rw
  21.         Selection.End(xlDown).Offset(a - Rw, -1).Value = Sheets(i).Name
  22.     Next a
  23.    
  24.     Selection.End(xlDown).Offset(1, 0).Select
  25. Next i
  26.  
  27. Application.ScreenUpdating = True
}

Tiene un tiempo de ejecución mucho mas rápido (son 216 hojas), en como 5 segundos entrega el resultado y creo que esta todo bien.

Gracias por el apoyo y @mrocf favor explícame tu código entiendo parte pero no todo y me gustaría aprender.