Probé pero no me salio. Antes tenia un if que me funcionaba pero no se como adaptarlo
Esta era la función
Function VerificarPedido() As Boolean
'Lunes
If ActiveSheet.Range("J22") = "SI" Then
If ActiveSheet.Range("E83") = "" Or ActiveSheet.Range("F83") = "" Then
lunes = "lunes, "
'MsgBox ("Falta seleccionar menu del Lunes")
End If
End If
'Martes
If ActiveSheet.Range("J34") = "SI" Then
If ActiveSheet.Range("G83") = "" Or ActiveSheet.Range("H83") = "" Then
martes = "martes, "
'MsgBox ("Falta seleccionar menu del Martes")
End If
End If
'Miercoles
If ActiveSheet.Range("J46") = "SI" Then
If ActiveSheet.Range("I83") = "" Or ActiveSheet.Range("J83") = "" Then
miercoles = "miercoles, "
'MsgBox ("Falta seleccionar menu del Miercoles")
End If
End If
'Jueves
If ActiveSheet.Range("J58") = "SI" Then
If ActiveSheet.Range("K83") = "" Or ActiveSheet.Range("L83") = "" Then
jueves = "jueves, "
'MsgBox ("Falta seleccionar menu del Jueves")
End If
End If
'Viernes
If ActiveSheet.Range("J70") = "SI" Then
If ActiveSheet.Range("M83") = "" Or ActiveSheet.Range("N83") = "" Then
viernes = "viernes, "
'MsgBox ("Falta seleccionar menu del Viernes")
End If
End If
If lunes = "lunes, " Or martes = "martes, " Or miercoles = "miercoles, " Or jueves = "jueves, " Or viernes = "viernes, " Then
'Alerta de los dias no completados
MsgBox ("Falta seleccionar menu, opcional ó postre del día: " + lunes + martes + miercoles + jueves + viernes)
'If a = vbNo Then Cancel = True
VerificarPedido = False
Exit Function
End If
VerificarPedido = True
End Function
y tewngo que ponerla para que se ejecute con esta macro
Sub BuscarLegajo()
If Range("E18") = "" Then
MsgBox "Ingrese el legajo primero"
Range("E18:F18").Select
Exit Sub
End If
ActiveSheet.Unprotect "manuel"
Sheets("NOMINA TODOS").Select
ActiveWindow.SmallScroll Down:=-15
Selection.AutoFilter
Range("A2:R328").Select
Selection.AutoFilter
ActiveWindow.SmallScroll Down:=-177
Sheets("Menu").Select
Dim SearchRange As Range
Dim FindRow As Range
Dim xlRange As Range
Dim hojaDato As Worksheet
Dim xlSheet As Worksheet
Dim valorBuscado As String
Set hojaDato = ActiveWorkbook.Worksheets("MENU")
valorBuscado = hojaDato.Range("E18")
Set xlSheet = ActiveWorkbook.Worksheets("NOMINA TODOS")
Set xlRange = xlSheet.Range("B1:B65536")
Set FindRow = xlRange.Find(valorBuscado, LookIn:=xlValues, lookat:=xlWhole) 'Legajo a buscar
'BuscarLegajo = "B" & FindRow.Row
xlSheet.Range("G" & FindRow.Row, "P" & FindRow.Row).Value = hojaDato.Range("E83:N83").Value
hojaDato.Range("Q22:Q71").Value = ""
Range("E18:F18").Select
Selection.Copy
Sheets("NOMINA TODOS").Select
Range("A1:B1").Select
ActiveSheet.Paste
MsgBox ("Menu copiado!!!")
Sheets("MENU").Select
Range("E18:E18").Select
ActiveWindow.SmallScroll Down:=-3
Range("Q22:Q86").Select
Selection.ClearContents
ActiveWindow.SmallScroll Down:=60
Range("D77:I77,L77:M77").Select
Range("L77").Activate
ActiveWindow.SmallScroll Down:=-12
Range("D77:I77,L77:M77,D65:I65,L65:M65").Select
Range("L65").Activate
ActiveWindow.SmallScroll Down:=-15
Range("D77:I77,L77:M77,D65:I65,L65:M65,D53:I53,L53:M53").Select
Range("L53").Activate
ActiveWindow.SmallScroll Down:=-9
Range("D77:I77,L77:M77,D65:I65,L65:M65,D53:I53,L53:M53,D41:I41,L41:M41").Select
Range("L41").Activate
ActiveWindow.SmallScroll Down:=-12
Range( _
"D77:I77,L77:M77,D65:I65,L65:M65,D53:I53,L53:M53,D41:I41,L41:M41,D29:I29,L29:M29" _
).Select
Range("L29").Activate
ActiveWindow.SmallScroll Down:=60
Selection.ClearContents
ActiveWindow.SmallScroll Down:=42
Range("J70").Select
ActiveCell.FormulaR1C1 = "SI"
Range("J58").Select
ActiveCell.FormulaR1C1 = "SI"
Range("J46").Select
ActiveCell.FormulaR1C1 = "SI"
Range("J34").Select
ActiveCell.FormulaR1C1 = "SI"
Range("J22").Select
ActiveCell.FormulaR1C1 = "SI"
Range("E18:F18").Select
Selection.ClearContents
Range("E18:F18").Select
ActiveWindow.SmallScroll Down:=3
Range("F22").Select
Selection.ClearContents
ActiveWindow.SmallScroll Down:=12
Range("F34").Select
Selection.ClearContents
ActiveWindow.SmallScroll Down:=24
Range("F58").Select
Selection.ClearContents
ActiveWindow.SmallScroll Down:=12
Range("F70").Select
Selection.ClearContents
ActiveWindow.SmallScroll Down:=15
Range("F70").Select
Selection.ClearContents
ActiveWindow.SmallScroll Down:=-18
Range("F58").Select
Selection.ClearContents
ActiveWindow.SmallScroll Down:=-12
Range("F46").Select
Selection.ClearContents
ActiveWindow.SmallScroll Down:=-12
Range("F34").Select
Selection.ClearContents
ActiveWindow.SmallScroll Down:=-9
Range("F22").Select
Selection.ClearContents
Range("E18:F18").Select
ActiveSheet.Protect "manuel"
ActiveWorkbook.Save
End Sub
te agradeceria mucho tu ayuda