Exportar Hojas si...

roberto

New Member
Joined
Aug 28, 2002
Messages
43
:D Hola:

Mi problema es el siguiente: Tengo 9 hojas en un libro, la primer hoja es una base de datos, las restantes son hojas pares, es decir: 1ªNota, Nota 1, 2ªNota, Nota 2, y asi sucesivamente (estas hojas estan como templates, solo para poner datos que estan vinculadas con la hoja base datos), quisiera que si las 2 primera hojas tengan datos, estas hojas se exporten, y si fueran 4 hojas con datos que estas mismas se exporten y asi...
¿Cual seria el codigo VBA para esto? Ojala pudieran ayudarme...
Gracias y perdon por si no respondo rápido... :wink:
 

Excel Facts

Which came first: VisiCalc or Lotus 1-2-3?
Dan Bricklin and Bob Frankston debuted VisiCalc in 1979 as a Visible Calculator. Lotus 1-2-3 debuted in the early 1980's, from Mitch Kapor.
Exportar hojas Si....

Perdon Juan P., seria a otro libro nuevo, basandonos que si en la hoja base datos en la celda A1 tiene valor, que la hoja 1ªNota y Nota 1 se exporten a dicho nuevo libro, y si tambien la celda A2 de la misma hoja base datos tiene valor se exporten tambien las hojas 2ªNota y Nota 2 y asi sucesivamente, unicamente si tiene valor las celdas A1, A2, A3...A8, se exporteran esas hojas, no se si me explico bien......
 
Upvote 0
Que pena la preguntadera, pero que signfica "Que tenga valor" ? un número cualquiera ? un texto cualquiera ? algo en particular ? pueden estar "llenas" las celdas A1 y A5 únicamente por ejemplo ? hay 8 "parejas" únicamente ?
 
Upvote 0
:oops: perdon por la tardanza, si un numero cualquiera y tienes razon, serian unicamente las celdas A1, A2, A3 y A4, que puedan tener valores cualquiera de estas celdas, automaticamente se ponen valores de texto en las hojas correspondientes:
A1 1ªNota Nota 1
A2 2ªNota Nota 2
A3 3ªNota Nota 3
A4 4ªNota Nota 4
y se pueden llenar de datos cualquiera de las celdas, un ejemplo seria la celda A1 y A4, y exportar a un nuevo libro las hojas 1ªNota y Nota 1, y 4ªNota y Nota 4 :D
 
Upvote 0
Aunque sigo sin entender muy bien, esto creo que sirve:

Option Explicit

Sub Exportar()
Dim WB As Workbook
Dim ActWb As Workbook
Dim Rng As Range
Dim i As Long

Set Rng = Range("A1:A4")
Set ActWb = ActiveWorkbook
If Application.Count(Rng) = 0 Then
MsgBox "No hay valores en las celdas !"
Else
Application.ScreenUpdating = False
Set WB = Workbooks.Add(xlWorksheet)
WB.Sheets(1).Name = "Temp"
For i = 1 To 4
If Len(Rng(i).Value) > 0 Then
ActWb.Sheets(Array(i & "ªNota", "Nota " & i)).Copy After:=WB.Sheets(WB.Sheets.Count)
End If
Next i
Application.DisplayAlerts = False
If WB.Sheets.Count > 1 Then WB.Sheets("Temp").Delete
Application.DisplayAlerts = True
Application.ScreenUpdating = True
End If
End Sub
 
Upvote 0
:lol: Me sale un error al momento de ejecutar la macro, me parece perfecto este codigo comparado con el mio que es un poco extenso, pero tal vez asi me puedas ayudar y lo puedas simplificar, este codigo si funciona con todas las 'ªNotas, el problema es cuando tambien quiero exportar las Nota ' las cuales no aparecen en el codigo que es el siguiente :-> :

Code:
Option Explicit
Private Declare Function GetUserName Lib "advapi32.dll" Alias "GetUserNameA" _
                                                        (ByVal lpBuffer As String, _
                                                        nSize As Long) As Long
Sub Salvar()
'
' Salvar Macro
'
Application.ScreenUpdating = False
    Sheets("1ª Nota").Visible = True
    Sheets("2ª Nota").Visible = True
    Sheets("3ª Nota").Visible = True
    Sheets("4ª Nota").Visible = True
    Sheets("5ª Nota").Visible = True
    Sheets("6ª Nota").Visible = True
    Sheets("7ª Nota").Visible = True
    Sheets("8ª Nota").Visible = True
    Sheets("9ª Nota").Visible = True
    Sheets("10ª Nota").Visible = True
    Sheets("11ª Nota").Visible = True
    Sheets("12ª Nota").Visible = True
    Sheets("13ª Nota").Visible = True
    Sheets("14ª Nota").Visible = True
    Sheets("15ª Nota").Visible = True
    Sheets("16ª Nota").Visible = True
    Sheets("17ª Nota").Visible = True
    Sheets("18ª Nota").Visible = True
    Sheets("19ª Nota").Visible = True
    Sheets("20ª Nota").Visible = True
    Sheets("21ª Nota").Visible = True
    Sheets("22ª Nota").Visible = True
    Sheets("23ª Nota").Visible = True
    Sheets("24ª Nota").Visible = True
    Sheets("25ª Nota").Visible = True
    Sheets("Períodos").Visible = True
   Sheets(Array("Resumen de NC", "1ª Nota", "2ª Nota", "3ª Nota", "4ª Nota", "5ª Nota", _
        "6ª Nota", "7ª Nota", "8ª Nota", "9ª Nota", "10ª Nota", "11ª Nota", "12ª Nota", _
        "13ª Nota", "14ª Nota", "15ª Nota", "16ª Nota", "17ª Nota", "18ª Nota", "19ª Nota", _
        "20ª Nota", "21ª Nota", "22ª Nota", "23ª Nota", "24ª Nota")).Select
    Sheets("Resumen de NC").Activate
    Sheets("25ª Nota").Select Replace:=False
    Sheets(Array("Resumen de NC", "1ª Nota", "2ª Nota", "3ª Nota", "4ª Nota", "5ª Nota", _
        "6ª Nota", "7ª Nota", "8ª Nota", "9ª Nota", "10ª Nota", "11ª Nota", "12ª Nota", _
        "13ª Nota", "14ª Nota", "15ª Nota", "16ª Nota", "17ª Nota", "18ª Nota", "19ª Nota", _
        "20ª Nota", "21ª Nota", "22ª Nota", "23ª Nota", "25ª Nota")).Select
    Sheets("25ª Nota").Activate
    Sheets("24ª Nota").Select Replace:=False
    Sheets(Array("Resumen de NC", "1ª Nota", "2ª Nota", "3ª Nota", "4ª Nota", "5ª Nota", _
        "6ª Nota", "7ª Nota", "8ª Nota", "9ª Nota", "10ª Nota", "11ª Nota", "12ª Nota", _
        "13ª Nota", "14ª Nota", "15ª Nota", "16ª Nota", "17ª Nota", "18ª Nota", "19ª Nota", _
        "20ª Nota", "21ª Nota", "22ª Nota", "23ª Nota", "24ª Nota", "25ª Nota")).Copy
    ActiveSheet.Unprotect
    Cells.Select
    Selection.Copy
    Selection.PasteSpecial Paste:=xlValues, Operation:=xlNone, SkipBlanks:= _
        False, Transpose:=False
    Selection.Interior.ColorIndex = xlNone
    Selection.Font.ColorIndex = 0
    With Selection.Validation
        .Delete
        .Add Type:=xlValidateInputOnly, AlertStyle:=xlValidAlertStop, Operator _
        :=xlBetween
        .IgnoreBlank = True
        .InCellDropdown = True
        .ShowInput = True
        .ShowError = True
    End With
    Selection.FormatConditions.Delete
    Range("K4").Select
    ActiveCell.FormulaR1C1 = "Hoja Convertida a Solo Valores"
    Range("K4").Select
    ActiveCell.FormulaR1C1 = "Hoja Convertida a Sólo Valores"
    Range("J4").Select
    Sheets("1ª Nota").Select
    If Sheets("Resumen de NC").Range("F6") = 0 Then
     Application.DisplayAlerts = False
     Worksheets("1ª Nota").Delete
     Application.DisplayAlerts = True
     ElseIf Sheets("Resumen de NC").Range("F6") <> 0 Then
    ActiveSheet.Unprotect
    Cells.Select
    Selection.Copy
    Selection.PasteSpecial Paste:=xlValues, Operation:=xlNone, SkipBlanks:= _
        False, Transpose:=False
    Range("E14:F15").Select
    Application.CutCopyMode = False
      End If
    Sheets("2ª Nota").Select
    If Sheets("Resumen de NC").Range("F7") = 0 Then
     Application.DisplayAlerts = False
     Worksheets("2ª Nota").Delete
     Application.DisplayAlerts = True
     ElseIf Sheets("Resumen de NC").Range("F7") <> 0 Then
    ActiveSheet.Unprotect
    Cells.Select
    Selection.Copy
    Selection.PasteSpecial Paste:=xlValues, Operation:=xlNone, SkipBlanks:= _
        False, Transpose:=False
    Range("E14:F15").Select
    Application.CutCopyMode = False
      End If
    Sheets("3ª Nota").Select
    If Sheets("Resumen de NC").Range("F8") = 0 Then
     Application.DisplayAlerts = False
     Worksheets("3ª Nota").Delete
     Application.DisplayAlerts = True
     ElseIf Sheets("Resumen de NC").Range("F8") <> 0 Then
    ActiveSheet.Unprotect
    Cells.Select
    Selection.Copy
    Selection.PasteSpecial Paste:=xlValues, Operation:=xlNone, SkipBlanks:= _
        False, Transpose:=False
    Range("E14:F15").Select
    Application.CutCopyMode = False
      End If
    Sheets("4ª Nota").Select
    If Sheets("Resumen de NC").Range("F9") = 0 Then
     Application.DisplayAlerts = False
     Worksheets("4ª Nota").Delete
     Application.DisplayAlerts = True
     ElseIf Sheets("Resumen de NC").Range("F9") <> 0 Then
    ActiveSheet.Unprotect
    Cells.Select
    Selection.Copy
    Selection.PasteSpecial Paste:=xlValues, Operation:=xlNone, SkipBlanks:= _
        False, Transpose:=False
    Range("E14:F15").Select
    Application.CutCopyMode = False
      End If
    Sheets("5ª Nota").Select
    If Sheets("Resumen de NC").Range("F10") = 0 Then
     Application.DisplayAlerts = False
     Worksheets("5ª Nota").Delete
     Application.DisplayAlerts = True
     ElseIf Sheets("Resumen de NC").Range("F10") <> 0 Then
    ActiveSheet.Unprotect
    Cells.Select
    Selection.Copy
    Selection.PasteSpecial Paste:=xlValues, Operation:=xlNone, SkipBlanks:= _
        False, Transpose:=False
    Range("E14:F15").Select
    Application.CutCopyMode = False
      End If
    Sheets("6ª Nota").Select
    If Sheets("Resumen de NC").Range("F11") = 0 Then
     Application.DisplayAlerts = False
     Worksheets("6ª Nota").Delete
     Application.DisplayAlerts = True
     ElseIf Sheets("Resumen de NC").Range("F11") <> 0 Then
    ActiveSheet.Unprotect
    Cells.Select
    Selection.Copy
    Selection.PasteSpecial Paste:=xlValues, Operation:=xlNone, SkipBlanks:= _
        False, Transpose:=False
    Range("E14:F15").Select
    Application.CutCopyMode = False
      End If
    Sheets("7ª Nota").Select
    Application.CutCopyMode = False
    If Sheets("Resumen de NC").Range("F12") = 0 Then
     Application.DisplayAlerts = False
     Worksheets("7ª Nota").Delete
     Application.DisplayAlerts = True
     ElseIf Sheets("Resumen de NC").Range("F12") <> 0 Then
    ActiveSheet.Unprotect
    Cells.Select
    Selection.Copy
    Selection.PasteSpecial Paste:=xlValues, Operation:=xlNone, SkipBlanks:= _
        False, Transpose:=False
    Range("E14:F15").Select
    Application.CutCopyMode = False
      End If
    Sheets("8ª Nota").Select
    If Sheets("Resumen de NC").Range("F13") = 0 Then
     Application.DisplayAlerts = False
     Worksheets("8ª Nota").Delete
     Application.DisplayAlerts = True
     ElseIf Sheets("Resumen de NC").Range("F13") <> 0 Then
    ActiveSheet.Unprotect
    Cells.Select
    Selection.Copy
    Selection.PasteSpecial Paste:=xlValues, Operation:=xlNone, SkipBlanks:= _
        False, Transpose:=False
    Range("E14:F15").Select
    Application.CutCopyMode = False
      End If
    Sheets("9ª Nota").Select
    If Sheets("Resumen de NC").Range("F14") = 0 Then
     Application.DisplayAlerts = False
     Worksheets("9ª Nota").Delete
     Application.DisplayAlerts = True
     ElseIf Sheets("Resumen de NC").Range("F14") <> 0 Then
    ActiveSheet.Unprotect
    Cells.Select
    Selection.Copy
    Selection.PasteSpecial Paste:=xlValues, Operation:=xlNone, SkipBlanks:= _
        False, Transpose:=False
    Range("E14:F15").Select
    Application.CutCopyMode = False
      End If
    Sheets("10ª Nota").Select
    If Sheets("Resumen de NC").Range("F15") = 0 Then
     Application.DisplayAlerts = False
     Worksheets("10ª Nota").Delete
     Application.DisplayAlerts = True
     ElseIf Sheets("Resumen de NC").Range("F15") <> 0 Then
    ActiveSheet.Unprotect
    Cells.Select
    Selection.Copy
    Selection.PasteSpecial Paste:=xlValues, Operation:=xlNone, SkipBlanks:= _
        False, Transpose:=False
    Range("E14:F15").Select
    Application.CutCopyMode = False
      End If
    Sheets("11ª Nota").Select
    If Sheets("Resumen de NC").Range("F16") = 0 Then
     Application.DisplayAlerts = False
     Worksheets("11ª Nota").Delete
     Application.DisplayAlerts = True
     ElseIf Sheets("Resumen de NC").Range("F16") <> 0 Then
    ActiveSheet.Unprotect
    Cells.Select
    Selection.Copy
    Selection.PasteSpecial Paste:=xlValues, Operation:=xlNone, SkipBlanks:= _
        False, Transpose:=False
    Range("E14:F15").Select
    Application.CutCopyMode = False
      End If
    Sheets("12ª Nota").Select
    If Sheets("Resumen de NC").Range("F17") = 0 Then
     Application.DisplayAlerts = False
     Worksheets("12ª Nota").Delete
     Application.DisplayAlerts = True
     ElseIf Sheets("Resumen de NC").Range("F17") <> 0 Then
    ActiveSheet.Unprotect
    Cells.Select
    Selection.Copy
    Selection.PasteSpecial Paste:=xlValues, Operation:=xlNone, SkipBlanks:= _
        False, Transpose:=False
    Range("E14:F15").Select
    Application.CutCopyMode = False
      End If
    Sheets("13ª Nota").Select
    ActiveSheet.Unprotect
    If Sheets("Resumen de NC").Range("F18") = 0 Then
     Application.DisplayAlerts = False
     Worksheets("13ª Nota").Delete
     Application.DisplayAlerts = True
     ElseIf Sheets("Resumen de NC").Range("F18") <> 0 Then
    Cells.Select
    Selection.Copy
    Selection.PasteSpecial Paste:=xlValues, Operation:=xlNone, SkipBlanks:= _
        False, Transpose:=False
    Range("E14:F15").Select
    Application.CutCopyMode = False
      End If
    Sheets("14ª Nota").Select
    If Sheets("Resumen de NC").Range("F19") = 0 Then
     Application.DisplayAlerts = False
     Worksheets("14ª Nota").Delete
     Application.DisplayAlerts = True
     ElseIf Sheets("Resumen de NC").Range("F19") <> 0 Then
    ActiveSheet.Unprotect
    Cells.Select
    Selection.Copy
    Selection.PasteSpecial Paste:=xlValues, Operation:=xlNone, SkipBlanks:= _
        False, Transpose:=False
    Range("E14:F15").Select
    Application.CutCopyMode = False
      End If
    Sheets("15ª Nota").Select
    If Sheets("Resumen de NC").Range("F20") = 0 Then
     Application.DisplayAlerts = False
     Worksheets("15ª Nota").Delete
     Application.DisplayAlerts = True
     ElseIf Sheets("Resumen de NC").Range("F20") <> 0 Then
    ActiveSheet.Unprotect
    Cells.Select
    Selection.Copy
    Selection.PasteSpecial Paste:=xlValues, Operation:=xlNone, SkipBlanks:= _
        False, Transpose:=False
    Range("E14:F15").Select
    Application.CutCopyMode = False
      End If
    Sheets("16ª Nota").Select
    If Sheets("Resumen de NC").Range("F21") = 0 Then
     Application.DisplayAlerts = False
     Worksheets("16ª Nota").Delete
     Application.DisplayAlerts = True
     ElseIf Sheets("Resumen de NC").Range("F21") <> 0 Then
    ActiveSheet.Unprotect
    Cells.Select
    Selection.Copy
    Selection.PasteSpecial Paste:=xlValues, Operation:=xlNone, SkipBlanks:= _
        False, Transpose:=False
    Range("E14:F15").Select
    Application.CutCopyMode = False
      End If
    Sheets("17ª Nota").Select
    If Sheets("Resumen de NC").Range("F22") = 0 Then
     Application.DisplayAlerts = False
     Worksheets("17ª Nota").Delete
     Application.DisplayAlerts = True
     ElseIf Sheets("Resumen de NC").Range("F22") <> 0 Then
    ActiveSheet.Unprotect
    Cells.Select
    Selection.Copy
    Selection.PasteSpecial Paste:=xlValues, Operation:=xlNone, SkipBlanks:= _
        False, Transpose:=False
    Range("E14:F15").Select
    Application.CutCopyMode = False
      End If
    Sheets("18ª Nota").Select
    If Sheets("Resumen de NC").Range("F23") = 0 Then
     Application.DisplayAlerts = False
     Worksheets("18ª Nota").Delete
     Application.DisplayAlerts = True
     ElseIf Sheets("Resumen de NC").Range("F23") <> 0 Then
    ActiveSheet.Unprotect
    Cells.Select
    Selection.Copy
    Selection.PasteSpecial Paste:=xlValues, Operation:=xlNone, SkipBlanks:= _
        False, Transpose:=False
    Application.CutCopyMode = False
    Range("E14:F15").Select
      End If
    Sheets("19ª Nota").Select
    If Sheets("Resumen de NC").Range("F24") = 0 Then
     Application.DisplayAlerts = False
     Worksheets("19ª Nota").Delete
     Application.DisplayAlerts = True
     ElseIf Sheets("Resumen de NC").Range("F24") <> 0 Then
    ActiveSheet.Unprotect
    Cells.Select
    Selection.Copy
    Selection.PasteSpecial Paste:=xlValues, Operation:=xlNone, SkipBlanks:= _
        False, Transpose:=False
    Range("E14:F15").Select
    Application.CutCopyMode = False
      End If
    Sheets("20ª Nota").Select
    If Sheets("Resumen de NC").Range("F25") = 0 Then
     Application.DisplayAlerts = False
     Worksheets("20ª Nota").Delete
     Application.DisplayAlerts = True
     ElseIf Sheets("Resumen de NC").Range("F25") <> 0 Then
    ActiveSheet.Unprotect
    Cells.Select
    Selection.Copy
    Selection.PasteSpecial Paste:=xlValues, Operation:=xlNone, SkipBlanks:= _
        False, Transpose:=False
    Range("E14:F15").Select
    Application.CutCopyMode = False
      End If
    Sheets("21ª Nota").Select
    If Sheets("Resumen de NC").Range("F26") = 0 Then
     Application.DisplayAlerts = False
     Worksheets("21ª Nota").Delete
     Application.DisplayAlerts = True
     ElseIf Sheets("Resumen de NC").Range("F26") <> 0 Then
    ActiveSheet.Unprotect
    Cells.Select
    Selection.Copy
    Selection.PasteSpecial Paste:=xlValues, Operation:=xlNone, SkipBlanks:= _
        False, Transpose:=False
    Range("E14:F15").Select
    Application.CutCopyMode = False
      End If
    Sheets("22ª Nota").Select
    If Sheets("Resumen de NC").Range("F27") = 0 Then
     Application.DisplayAlerts = False
     Worksheets("22ª Nota").Delete
     Application.DisplayAlerts = True
     ElseIf Sheets("Resumen de NC").Range("F27") <> 0 Then
    ActiveSheet.Unprotect
    Cells.Select
    Selection.Copy
    Selection.PasteSpecial Paste:=xlValues, Operation:=xlNone, SkipBlanks:= _
        False, Transpose:=False
    Range("E14:F15").Select
    Application.CutCopyMode = False
      End If
    Sheets("23ª Nota").Select
    If Sheets("Resumen de NC").Range("F28") = 0 Then
     Application.DisplayAlerts = False
     Worksheets("23ª Nota").Delete
     Application.DisplayAlerts = True
     ElseIf Sheets("Resumen de NC").Range("F28") <> 0 Then
    ActiveSheet.Unprotect
    Cells.Select
    Selection.Copy
    Selection.PasteSpecial Paste:=xlValues, Operation:=xlNone, SkipBlanks:= _
        False, Transpose:=False
    Range("E14:F15").Select
    Application.CutCopyMode = False
      End If
    Sheets("24ª Nota").Select
    If Sheets("Resumen de NC").Range("F29") = 0 Then
     Application.DisplayAlerts = False
     Worksheets("24ª Nota").Delete
     Application.DisplayAlerts = True
     ElseIf Sheets("Resumen de NC").Range("F29") <> 0 Then
    ActiveSheet.Unprotect
    Cells.Select
    Selection.Copy
    Selection.PasteSpecial Paste:=xlValues, Operation:=xlNone, SkipBlanks:= _
        False, Transpose:=False
    Range("E14:F15").Select
    Application.CutCopyMode = False
      End If
    Sheets("25ª Nota").Select
    If Sheets("Resumen de NC").Range("F30") = 0 Then
     Application.DisplayAlerts = False
     Worksheets("25ª Nota").Delete
     Application.DisplayAlerts = True
     ElseIf Sheets("Resumen de NC").Range("F30") <> 0 Then
    ActiveSheet.Unprotect
    Cells.Select
    Selection.Copy
    Selection.PasteSpecial Paste:=xlValues, Operation:=xlNone, SkipBlanks:= _
        False, Transpose:=False
    Range("E14:F15").Select
    Application.CutCopyMode = False
     End If
    ActiveWindow.ScrollWorkbookTabs Position:=xlFirst
    Sheets("Resumen de NC").Select
    ActiveSheet.Unprotect
    If Sheets("Resumen de NC").Range("F7") = 0 Then
    Range("AH7").Select
    Range(Selection, Selection.End(xlDown)).Select
    Selection.EntireRow.Delete
    Cells.Select
    Selection.EntireRow.Hidden = False
    Range("E3").Select
    Selection.Copy
    Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
        :=False, Transpose:=False
    ActiveWorkbook.SaveAs Application.Substitute(Range("E3").Text, ":", "-")
     ElseIf Sheets("Resumen de NC").Range("F7") <> 0 Then
    ActiveWindow.ScrollWorkbookTabs Position:=xlFirst
    Range("C6").Select
    Range("F6").Select
    Range(Selection, Selection.End(xlDown)).Select
    Selection.EntireRow.Hidden = True
    Range("AH30").Select
    Range(Selection, Selection.End(xlUp)).Select
    Selection.EntireRow.Delete
    Cells.Select
    Selection.EntireRow.Hidden = False
    Range("C6").Select
    Range("E3").Select
    Selection.Copy
    Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
        :=False, Transpose:=False
    ActiveWorkbook.SaveAs Application.Substitute(Range("E3").Text, ":", "-")
    Application.StatusBar = False
    End If
    Dim lpBuff As String * 25
    Dim ret As Long, UserName As String
    ret = GetUserName(lpBuff, 25)
    UserName = Left(lpBuff, InStr(lpBuff, Chr(0)) - 1)
    MsgBox UserName & vbCr & "Este libro será guardado en el archivo" & vbCr & "''Mis Documentos'' ó en ''c:\'' y con el nombre de:" & vbCr & vbCr & "''Preforma NC (''Fecha y Hora'') {Listado Anexo ''EXT''}''"
    ActiveSheet.Shapes("Text Box 1").Select
    Selection.Delete
    Range("E3").Select
    Selection.ClearContents
    Range("AH6:AH30").Select
    Selection.ClearContents
    Range("U1:AE4").Select
    Selection.ClearContents
    Selection.ClearFormats
    Range("C6").Select
    Workbooks("Preforma NC (Anexo ''EXT'').xls").Close savechanges:=False
Application.StatusBar = False
Application.ScreenUpdating = True
End Sub

No se si te pueda mandar el archivo de excel para que lo veas y a que dirección de email seria.
Gracias.....
 
Upvote 0
El error me sale en la siguiente linea del primer codigo que me mostraste:

ActWb.Sheets(Array(i & "ªNota", "Nota " & i)).Copy

y la(s) hoja(s) son con el espacio, estas hojas no aparecen en el segundo codigo la cual me funciona bien, pero quiero si se puede que tambien las exporte con la misma logica que las 'ª Nota, :idea: ahora me doy cuenta que el error puede estar en el espacio del que me hablas en el codigo que amablemente me proporcionaste.... :D
 
Upvote 0
:o Caravana y aplausos Sr. Juan Pablo:

tenias razón con el comentario hecho anteriormente, trabaja a las mil maravillas, con este codigo podre ahorrar memoria y es justo lo que buscaba :P

:-> Excelente, en serio ¡ E X C E L E N T E !
 
Upvote 0

Forum statistics

Threads
1,223,934
Messages
6,175,488
Members
452,648
Latest member
Candace H

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top