HOLA DAN
Como la adapto para agregarla un código
El cual es este.. si quieres abro una pregunta
Sub PAN_PEDIR()
Application.ScreenUpdating = False
If Range("E1") > 0 Then
MsgBox "NO PODEMOS CONTINUAR, PORFAVOR: VERIFIQUE SU PEDIDO", vbExclamation, "LO SENTIMOS"
Exit Sub
End If
Dim s As Long
s = Application.WorksheetFunction.Sum(Range("G6:T300"))
If s = Empty Then
MsgBox "NO HAY CANTIDADES PARA REALIZAR PEDIDO", vbCritical, "ERROR"
Else
Dim PEDIDO As Variant
' Application.Speech.Speak "¿EL CLIENTE SOLICITARÁ FACTURA?"
PEDIDO = MsgBox("¿REALIZAR PEDIDO?", vbYesNo + vbQuestion, "AVISO")
If PEDIDO = vbYes Then
'FILTRA LOS PRODUCTOS CON MAYOR A CERO
ActiveSheet.Unprotect
ActiveSheet.Range("$F$5:$F$300").AutoFilter Field:=1, Criteria1:=">0", _
Operator:=xlAnd
'IMPRIMIMOS REPORTE APTS
Range("B2:P301").Select
ActiveSheet.PageSetup.PrintArea = "$B$2:$T$301"
'QUITAMOS RELLENO VERDE
ActiveSheet.Unprotect
Cells.Select
Range("B1").Activate
With Selection.Interior
ActiveSheet.Unprotect
.Pattern = xlNone
.TintAndShade = 0
.PatternTintAndShade = 0
End With
'IMPRIMIMOS
ActiveWindow.SelectedSheets.PrintOut Copies:=1, Collate:=True, _
IgnorePrintAreas:=False
Sheets("PANADERIA").Select
Application.ScreenUpdating = False
Call guardaCopiaPANADERIA
'AQUÍ FILTRA MAYOR QUE CERO EN LA HOJA DE IMPRESIÓN
Sheets("IMPRIME PAN").Activate
ActiveSheet.Unprotect
ActiveSheet.Range("$C$5:$C$300").AutoFilter Field:=1, Criteria1:=">0", _
Operator:=xlAnd
'QUITAMOS RELLENO VERDE
ActiveSheet.Unprotect
Cells.Select
Range("B1").Activate
With Selection.Interior
ActiveSheet.Unprotect
.Pattern = xlNone
.TintAndShade = 0
.PatternTintAndShade = 0
End With
'IMPRIMIMOS POR SEGUNDA VEZ
Range("B2:F308").Select
ActiveSheet.PageSetup.PrintArea = "$B$2:$f$308"
ActiveWindow.SelectedSheets.PrintOut Copies:=1, Collate:=True, _
IgnorePrintAreas:=False
'REGRESAMOS AL AREA CORRESPONDIENTE
Sheets("PANADERIA").Select
'QUITAMOS FILTRO DEL AREA Y BORRAMOS CONTENIDO
Application.ScreenUpdating = False
ActiveSheet.Unprotect
ActiveSheet.Range("$F$5:$F$300").AutoFilter Field:=1
Range("G6:T300").Select
ActiveSheet.Unprotect
Selection.ClearContents
Range("G6").Select
'QUITAMOS FILTRO DE IMPRESIÓN
Sheets("IMPRIME PAN").Activate
ActiveSheet.Range("$C$5:$C$300").AutoFilter Field:=1
'REGRESAMOS DE NUEVO AL AREA
Sheets("PANADERIA").Select
ActiveSheet.Unprotect
[E2] = "PN" & Format(Val(Right([E2], 3)) + 1, "00000")
MsgBox "PEDIDO REALIZADO", vbOKOnly, "EN HORA BUENA"
If PEDIDO = vbNo Then
MsgBox "PEDIDO CANCELADO", vbInformation, "PANADERIA"
End If
End If
End If
End Sub