Macro para copiar hoja "REPORTE" con nombre de fecha actual y que solamente se pueda copiar una vez por día

Espero me puedan ayudar, quiero evitar que se me muestre este mensaje y se vayan agregando hojas (REPORTE (2), REPORTE(3), ETC... GRACIAS

1 Respuesta

Respuesta

[Hola 

Te paso la macro


Para finalizar hay 2 opciones Excelente o bueno saludos!

Sub copiahoja()
'
'**Por Adriel Ortiz
'
Application.ScreenUpdating = False
Sheets("Reporte").Visible = False
existe = False
For Each h In Sheets
    nom = Format(Date, "mm-dd-yyyy")
    If h.Name = nom Then
        existe = True
        MsgBox "Ya existe la copia"
        Exit For
    End If
Next
If existe = False Then
   Sheets("Reporte").Copy After:=Sheets(ActiveWorkbook.Sheets.Count)
   ActiveSheet.Name = Format(Date, "mm-dd-yyyy")
End If
Sheets("Reporte").Visible = False
Application.ScreenUpdating = True
End Sub

Añade tu respuesta

Haz clic para o

Más respuestas relacionadas