Aretradeser
Board Regular
- Joined
- Jan 16, 2013
- Messages
- 176
- Office Version
- 2013
- Platform
- Windows
To this VBA code, I need to add one more filter, to choose from the data in Column 14, but I would like to be able to do it from a MsgBox. Is it possible?
Rich (BB code):
Sub InformeDesplazmientoEspaña()
On Error Resume Next
m = MsgBox("¿QUIERE REALIZAR EL INFORME?", vbQuestion + vbYesNoCancel, "INFORME")
If m = vbCancel Then Exit Sub
Application.ScreenUpdating = False
Sheets("INFORMES").Unprotect ("123")
Sheets("BDATOS").Unprotect ("123")
Sheets("BDATOS").Range("A1").AutoFilter Field:=7, Criteria1:="España"
With Sheets("INFORMES")
.Range("A2:L65536") = ""
Sheets("BDATOS").Range("A2:L" & Sheets("BDATOS").Range("a65536").End(xlUp).Row).SpecialCells(xlCellTypeVisible).Copy _
Destination:=.Range("A2")
.Cells.FormatConditions.Delete
.Range("A2:L" & .Range("a65536").End(xlUp).Row).Interior.ColorIndex = xlNone
End With
Sheets("BDATOS").Range("b1").AutoFilter = False
Sheets("BDATOS").Protect ("123")
'Application.ScreenUpdating = True
Sheets("INFORMES").Select
Ajustar
Range("A1").Select
Sheets("INFORMES").Protect ("123")
MsgBox "INFORME REALIZADO", vbInformation + vbOKOnly, "INFORME"
Exit Sub
End Sub