Como activar macro al cambiar el valor de celda
Tengo una macro que abajo detallo, quiero que se active al cambiar los valores de la celda"a4" de mi hoja1, ¿qué instrucción debo agregar?,, gracias...
Sub Printer_Comanda()
'
'
Application.ScreenUpdating = False
ActiveWorkbook.Unprotect
Sheets("HOJA2").Visible = True
Sheets("HOJA1").Select
Range("A4").Select
Selection.Copy
Sheets("HOJA2").Select
Range("B3").Select
Selection.Insert Shift:=xlDown
Sheets("HOJA2").Select
Range("A3").Select
Application.CutCopyMode = False
Selection.Insert Shift:=xlDown
Range("A3").Select
ActiveCell.FormulaR1C1 = "=NOW()"
Rows("3:3").Select
Selection.Copy
Selection.PasteSpecial Paste:=xlValues, Operation:=xlNone, SkipBlanks:= _
False, Transpose:=False
Range("A5").Select
Application.CutCopyMode = False
Sheets("HOJA2").Select
ActiveWindow.SelectedSheets.Visible = False
ActiveWorkbook.Protect Structure:=True, Windows:=False
Range("A4").Select
ActiveWindow.SelectedSheets.PrintOut Copies:=1, Collate:=True
Range("A4").Select
ActiveCell.FormulaR1C1 = "CIERRE"
ActiveWorkbook.Save
Application.ScreenUpdating = True
End Sub
Sub Printer_Comanda()
'
'
Application.ScreenUpdating = False
ActiveWorkbook.Unprotect
Sheets("HOJA2").Visible = True
Sheets("HOJA1").Select
Range("A4").Select
Selection.Copy
Sheets("HOJA2").Select
Range("B3").Select
Selection.Insert Shift:=xlDown
Sheets("HOJA2").Select
Range("A3").Select
Application.CutCopyMode = False
Selection.Insert Shift:=xlDown
Range("A3").Select
ActiveCell.FormulaR1C1 = "=NOW()"
Rows("3:3").Select
Selection.Copy
Selection.PasteSpecial Paste:=xlValues, Operation:=xlNone, SkipBlanks:= _
False, Transpose:=False
Range("A5").Select
Application.CutCopyMode = False
Sheets("HOJA2").Select
ActiveWindow.SelectedSheets.Visible = False
ActiveWorkbook.Protect Structure:=True, Windows:=False
Range("A4").Select
ActiveWindow.SelectedSheets.PrintOut Copies:=1, Collate:=True
Range("A4").Select
ActiveCell.FormulaR1C1 = "CIERRE"
ActiveWorkbook.Save
Application.ScreenUpdating = True
End Sub
1 Respuesta
Respuesta de Elsa Matilde
1