Ver Mensaje Individual
  #8 (permalink)  
Antiguo 02/12/2011, 14:49
Avatar de mrocf
mrocf
 
Fecha de Ingreso: marzo-2007
Ubicación: Bs.As.
Mensajes: 1.103
Antigüedad: 17 años, 1 mes
Puntos: 88
De acuerdo Respuesta: Separar columnas de excel en páginas

Te sugeriría que reemplaces la macro que tienes por esta otra variante:
Código PHP:
Sub LibrosPorGrupos()
Dim lastCol As Integerii As Integer
Dim myPath 
As StringnewName As Stringfso As Object

If ThisWorkbook.Path = Empty Then
  MsgBox 
"Debes -primero- guardar este libro..."
  
End
End 
If
Application.ScreenUpdating False
myPath 
ThisWorkbook.Path "\PorGrupos"
Set fso CreateObject("Scripting.FileSystemObject")
If 
fso.FolderExists(myPathThen
  fso
.DeleteFolder (myPath)
End If
fso.CreateFolder myPath
Set fso 
Nothing

lastCol 
Cells(3Columns.Count).End(xlToLeft).Column

For ii 1 To lastCol Step 5
  With Worksheets
("Nombres").Cells(1, (ii) / 5)
    If .
Value "" Then
      newName 
myPath "\_SinNombre " & .Column
    
Else
      
newName myPath "\" & .Value
    End If
  End With

  Range(Cells(1, ii), Cells(Rows.Count, ii).End(xlUp)).Resize(, 4).Copy
  Workbooks.Add xlWBATWorksheet
  ActiveSheet.Paste
  ActiveWorkbook.Close True, newName
Next ii

Application.ScreenUpdating = True
Shell "
Explorer " & myPath, vbMaximizedFocus
End Sub 
Y ejecútala teniendo la hoja Hoja1 (o como sea que la llames) seleccionada.

¿Te puede servir?...
Saludos, Cacho R.