Repetir Macro desde una Hoja hasta la ultima hoja
Tengo un proceso determinado y quiero que se repita hasta la ultima Hoja, lo que pasa es que a veces voy agregando Hojas y tengo que andar modificando el código.
1 Respuesta
Sub DejarEnCero()
'Analia'
Sheets("Analia").Select
Range("C2").Select
ActiveCell.FormulaR1C1 = "0"
Range("C4").Select
ActiveCell.FormulaR1C1 = "0"
Range("C5").Select
ActiveCell.FormulaR1C1 = "0"
Range("C6").Select
ActiveCell.FormulaR1C1 = "0"
Range("C7").Select
ActiveCell.FormulaR1C1 = "0"
Range("C9").Select
ActiveCell.FormulaR1C1 = "0"
Range("C10").Select
ActiveCell.FormulaR1C1 = "0"
Range("F3:G3").Select
ActiveCell.FormulaR1C1 = ""
Range("D13").Select
ActiveCell.FormulaR1C1 = "0"
Range("G18").Select
ActiveCell.FormulaR1C1 = ""
Range("E19:I21").Select
ActiveCell.FormulaR1C1 = ""
Range("D39").Select
ActiveCell.FormulaR1C1 = "0"
Range("D40").Select
ActiveCell.FormulaR1C1 = "0"
Range("H38").Select
ActiveCell.FormulaR1C1 = "1"
Range("A1").Select
'Antonio'
ActiveSheet.Next.Select
Range("C2").Select
ActiveCell.FormulaR1C1 = "0"
Range("C4").Select
ActiveCell.FormulaR1C1 = "0"
Range("C5").Select
ActiveCell.FormulaR1C1 = "0"
Range("C6").Select
ActiveCell.FormulaR1C1 = "0"
Range("C7").Select
ActiveCell.FormulaR1C1 = "0"
Range("C9").Select
ActiveCell.FormulaR1C1 = "0"
Range("C10").Select
ActiveCell.FormulaR1C1 = "0"
Range("F3:G3").Select
ActiveCell.FormulaR1C1 = ""
Range("D13").Select
ActiveCell.FormulaR1C1 = "0"
Range("G18").Select
ActiveCell.FormulaR1C1 = ""
Range("E19:I21").Select
ActiveCell.FormulaR1C1 = ""
Range("D39").Select
ActiveCell.FormulaR1C1 = "0"
Range("D40").Select
ActiveCell.FormulaR1C1 = "0"
Range("H38").Select
ActiveCell.FormulaR1C1 = "1"
Range("A1").Select
'Fer'
ActiveSheet.Next.Select
Range("C2").Select
ActiveCell.FormulaR1C1 = "0"
Range("C4").Select
ActiveCell.FormulaR1C1 = "0"
Range("C5").Select
ActiveCell.FormulaR1C1 = "0"
Range("C6").Select
ActiveCell.FormulaR1C1 = "0"
Range("C7").Select
ActiveCell.FormulaR1C1 = "0"
Range("C9").Select
ActiveCell.FormulaR1C1 = "0"
Range("C10").Select
ActiveCell.FormulaR1C1 = "0"
Range("F3:G3").Select
ActiveCell.FormulaR1C1 = ""
Range("D13").Select
ActiveCell.FormulaR1C1 = "0"
Range("G18").Select
ActiveCell.FormulaR1C1 = ""
Range("E19:I21").Select
ActiveCell.FormulaR1C1 = ""
Range("D39").Select
ActiveCell.FormulaR1C1 = "0"
Range("D40").Select
ActiveCell.FormulaR1C1 = "0"
Range("H38").Select
ActiveCell.FormulaR1C1 = "1"
Range("A1").Select
'Negro'
ActiveSheet.Next.Select
Range("C2").Select
ActiveCell.FormulaR1C1 = "0"
Range("C4").Select
ActiveCell.FormulaR1C1 = "0"
Range("C5").Select
ActiveCell.FormulaR1C1 = "0"
Range("C6").Select
ActiveCell.FormulaR1C1 = "0"
Range("C7").Select
ActiveCell.FormulaR1C1 = "0"
Range("C9").Select
ActiveCell.FormulaR1C1 = "0"
Range("C10").Select
ActiveCell.FormulaR1C1 = "0"
Range("F3:G3").Select
ActiveCell.FormulaR1C1 = ""
Range("D13").Select
ActiveCell.FormulaR1C1 = "0"
Range("G18").Select
ActiveCell.FormulaR1C1 = ""
Range("E19:I21").Select
ActiveCell.FormulaR1C1 = ""
Range("D39").Select
ActiveCell.FormulaR1C1 = "0"
Range("D40").Select
ActiveCell.FormulaR1C1 = "0"
Range("H38").Select
ActiveCell.FormulaR1C1 = "1"
Range("A1").Select
'Ivan'
ActiveSheet.Next.Select
Range("C2").Select
ActiveCell.FormulaR1C1 = "0"
Range("C4").Select
ActiveCell.FormulaR1C1 = "0"
Range("C5").Select
ActiveCell.FormulaR1C1 = "0"
Range("C6").Select
ActiveCell.FormulaR1C1 = "0"
Range("C7").Select
ActiveCell.FormulaR1C1 = "0"
Range("C9").Select
ActiveCell.FormulaR1C1 = "0"
Range("C10").Select
ActiveCell.FormulaR1C1 = "0"
Range("F3:G3").Select
ActiveCell.FormulaR1C1 = ""
Range("D13").Select
ActiveCell.FormulaR1C1 = "0"
Range("G18").Select
ActiveCell.FormulaR1C1 = ""
Range("E19:I21").Select
ActiveCell.FormulaR1C1 = ""
Range("D39").Select
ActiveCell.FormulaR1C1 = "0"
Range("D40").Select
ActiveCell.FormulaR1C1 = "0"
Range("H38").Select
ActiveCell.FormulaR1C1 = "1"
Range("A1").Select
'Javier'
ActiveSheet.Next.Select
Range("C2").Select
ActiveCell.FormulaR1C1 = "0"
Range("C4").Select
ActiveCell.FormulaR1C1 = "0"
Range("C5").Select
ActiveCell.FormulaR1C1 = "0"
Range("C6").Select
ActiveCell.FormulaR1C1 = "0"
Range("C7").Select
ActiveCell.FormulaR1C1 = "0"
Range("C9").Select
ActiveCell.FormulaR1C1 = "0"
Range("C10").Select
ActiveCell.FormulaR1C1 = "0"
Range("F3:G3").Select
ActiveCell.FormulaR1C1 = ""
Range("D13").Select
ActiveCell.FormulaR1C1 = "0"
Range("G18").Select
ActiveCell.FormulaR1C1 = ""
Range("E19:I21").Select
ActiveCell.FormulaR1C1 = ""
Range("D39").Select
ActiveCell.FormulaR1C1 = "0"
Range("D40").Select
ActiveCell.FormulaR1C1 = "0"
Range("H38").Select
ActiveCell.FormulaR1C1 = "1"
Range("A1").Select
'Ariel'
ActiveSheet.Next.Select
Range("C2").Select
ActiveCell.FormulaR1C1 = "0"
Range("C4").Select
ActiveCell.FormulaR1C1 = "0"
Range("C5").Select
ActiveCell.FormulaR1C1 = "0"
Range("C6").Select
ActiveCell.FormulaR1C1 = "0"
Range("C7").Select
ActiveCell.FormulaR1C1 = "0"
Range("C9").Select
ActiveCell.FormulaR1C1 = "0"
Range("C10").Select
ActiveCell.FormulaR1C1 = "0"
Range("F3:G3").Select
ActiveCell.FormulaR1C1 = ""
Range("D13").Select
ActiveCell.FormulaR1C1 = "0"
Range("G18").Select
ActiveCell.FormulaR1C1 = ""
Range("E19:I21").Select
ActiveCell.FormulaR1C1 = ""
Range("D39").Select
ActiveCell.FormulaR1C1 = "0"
Range("D40").Select
ActiveCell.FormulaR1C1 = "0"
Range("H38").Select
ActiveCell.FormulaR1C1 = "1"
Range("A1").Select
'Leo'
ActiveSheet.Next.Select
Range("C2").Select
ActiveCell.FormulaR1C1 = "0"
Range("C4").Select
ActiveCell.FormulaR1C1 = "0"
Range("C5").Select
ActiveCell.FormulaR1C1 = "0"
Range("C6").Select
ActiveCell.FormulaR1C1 = "0"
Range("C7").Select
ActiveCell.FormulaR1C1 = "0"
Range("C9").Select
ActiveCell.FormulaR1C1 = "0"
Range("C10").Select
ActiveCell.FormulaR1C1 = "0"
Range("F3:G3").Select
ActiveCell.FormulaR1C1 = ""
Range("D13").Select
ActiveCell.FormulaR1C1 = "0"
Range("G18").Select
ActiveCell.FormulaR1C1 = ""
Range("E19:I21").Select
ActiveCell.FormulaR1C1 = ""
Range("D39").Select
ActiveCell.FormulaR1C1 = "0"
Range("D40").Select
ActiveCell.FormulaR1C1 = "0"
Range("H38").Select
ActiveCell.FormulaR1C1 = "1"
Range("A1").Select
'Emanuel'
ActiveSheet.Next.Select
Range("C2").Select
ActiveCell.FormulaR1C1 = "0"
Range("C4").Select
ActiveCell.FormulaR1C1 = "0"
Range("C5").Select
ActiveCell.FormulaR1C1 = "0"
Range("C6").Select
ActiveCell.FormulaR1C1 = "0"
Range("C7").Select
ActiveCell.FormulaR1C1 = "0"
Range("C9").Select
ActiveCell.FormulaR1C1 = "0"
Range("C10").Select
ActiveCell.FormulaR1C1 = "0"
Range("F3:G3").Select
ActiveCell.FormulaR1C1 = ""
Range("D13").Select
ActiveCell.FormulaR1C1 = "0"
Range("G18").Select
ActiveCell.FormulaR1C1 = ""
Range("E19:I21").Select
ActiveCell.FormulaR1C1 = ""
Range("D39").Select
ActiveCell.FormulaR1C1 = "0"
Range("D40").Select
ActiveCell.FormulaR1C1 = "0"
Range("H38").Select
ActiveCell.FormulaR1C1 = "1"
Range("A1").Select
'Raul B.'
ActiveSheet.Next.Select
Range("C2").Select
ActiveCell.FormulaR1C1 = "0"
Range("C4").Select
ActiveCell.FormulaR1C1 = "0"
Range("C5").Select
ActiveCell.FormulaR1C1 = "0"
Range("C6").Select
ActiveCell.FormulaR1C1 = "0"
Range("C7").Select
ActiveCell.FormulaR1C1 = "0"
Range("C9").Select
ActiveCell.FormulaR1C1 = "0"
Range("C10").Select
ActiveCell.FormulaR1C1 = "0"
Range("F3:G3").Select
ActiveCell.FormulaR1C1 = ""
Range("D13").Select
ActiveCell.FormulaR1C1 = "0"
Range("G18").Select
ActiveCell.FormulaR1C1 = ""
Range("E19:I21").Select
ActiveCell.FormulaR1C1 = ""
Range("D39").Select
ActiveCell.FormulaR1C1 = "0"
Range("D40").Select
ActiveCell.FormulaR1C1 = "0"
Range("H38").Select
ActiveCell.FormulaR1C1 = "1"
Range("A1").Select
'Sebastian'
ActiveSheet.Next.Select
Range("C2").Select
ActiveCell.FormulaR1C1 = "0"
Range("C4").Select
ActiveCell.FormulaR1C1 = "0"
Range("C5").Select
ActiveCell.FormulaR1C1 = "0"
Range("C6").Select
ActiveCell.FormulaR1C1 = "0"
Range("C7").Select
ActiveCell.FormulaR1C1 = "0"
Range("C9").Select
ActiveCell.FormulaR1C1 = "0"
Range("C10").Select
ActiveCell.FormulaR1C1 = "0"
Range("F3:G3").Select
ActiveCell.FormulaR1C1 = ""
Range("D13").Select
ActiveCell.FormulaR1C1 = "0"
Range("G18").Select
ActiveCell.FormulaR1C1 = ""
Range("E19:I21").Select
ActiveCell.FormulaR1C1 = ""
Range("D39").Select
ActiveCell.FormulaR1C1 = "0"
Range("D40").Select
ActiveCell.FormulaR1C1 = "0"
Range("H38").Select
ActiveCell.FormulaR1C1 = "1"
Range("A1").Select
'Ezequiel'
ActiveSheet.Next.Select
Range("C2").Select
ActiveCell.FormulaR1C1 = "0"
Range("C4").Select
ActiveCell.FormulaR1C1 = "0"
Range("C5").Select
ActiveCell.FormulaR1C1 = "0"
Range("C6").Select
ActiveCell.FormulaR1C1 = "0"
Range("C7").Select
ActiveCell.FormulaR1C1 = "0"
Range("C9").Select
ActiveCell.FormulaR1C1 = "0"
Range("C10").Select
ActiveCell.FormulaR1C1 = "0"
Range("F3:G3").Select
ActiveCell.FormulaR1C1 = ""
Range("D13").Select
ActiveCell.FormulaR1C1 = "0"
Range("G18").Select
ActiveCell.FormulaR1C1 = ""
Range("E19:I21").Select
ActiveCell.FormulaR1C1 = ""
Range("D39").Select
ActiveCell.FormulaR1C1 = "0"
Range("D40").Select
ActiveCell.FormulaR1C1 = "0"
Range("H38").Select
ActiveCell.FormulaR1C1 = "1"
Range("A1").Select
'Gimenez'
ActiveSheet.Next.Select
Range("C2").Select
ActiveCell.FormulaR1C1 = "0"
Range("C4").Select
ActiveCell.FormulaR1C1 = "0"
Range("C5").Select
ActiveCell.FormulaR1C1 = "0"
Range("C6").Select
ActiveCell.FormulaR1C1 = "0"
Range("C7").Select
ActiveCell.FormulaR1C1 = "0"
Range("C9").Select
ActiveCell.FormulaR1C1 = "0"
Range("C10").Select
ActiveCell.FormulaR1C1 = "0"
Range("F3:G3").Select
ActiveCell.FormulaR1C1 = ""
Range("D13").Select
ActiveCell.FormulaR1C1 = "0"
Range("G18").Select
ActiveCell.FormulaR1C1 = ""
Range("E19:I21").Select
ActiveCell.FormulaR1C1 = ""
Range("D39").Select
ActiveCell.FormulaR1C1 = "0"
Range("D40").Select
ActiveCell.FormulaR1C1 = "0"
Range("H38").Select
ActiveCell.FormulaR1C1 = "1"
Range("A1").Select
'Jorge'
ActiveSheet.Next.Select
Range("C2").Select
ActiveCell.FormulaR1C1 = "0"
Range("C4").Select
ActiveCell.FormulaR1C1 = "0"
Range("C5").Select
ActiveCell.FormulaR1C1 = "0"
Range("C6").Select
ActiveCell.FormulaR1C1 = "0"
Range("C7").Select
ActiveCell.FormulaR1C1 = "0"
Range("C9").Select
ActiveCell.FormulaR1C1 = "0"
Range("C10").Select
ActiveCell.FormulaR1C1 = "0"
Range("F3:G3").Select
ActiveCell.FormulaR1C1 = ""
Range("D13").Select
ActiveCell.FormulaR1C1 = "0"
Range("G18").Select
ActiveCell.FormulaR1C1 = ""
Range("E19:I21").Select
ActiveCell.FormulaR1C1 = ""
Range("D39").Select
ActiveCell.FormulaR1C1 = "0"
Range("D40").Select
ActiveCell.FormulaR1C1 = "0"
Range("H38").Select
ActiveCell.FormulaR1C1 = "1"
Range("A1").Select
'David'
ActiveSheet.Next.Select
Range("C2").Select
ActiveCell.FormulaR1C1 = "0"
Range("C4").Select
ActiveCell.FormulaR1C1 = "0"
Range("C5").Select
ActiveCell.FormulaR1C1 = "0"
Range("C6").Select
ActiveCell.FormulaR1C1 = "0"
Range("C7").Select
ActiveCell.FormulaR1C1 = "0"
Range("C9").Select
ActiveCell.FormulaR1C1 = "0"
Range("C10").Select
ActiveCell.FormulaR1C1 = "0"
Range("F3:G3").Select
ActiveCell.FormulaR1C1 = ""
Range("D13").Select
ActiveCell.FormulaR1C1 = "0"
Range("G18").Select
ActiveCell.FormulaR1C1 = ""
Range("E19:I21").Select
ActiveCell.FormulaR1C1 = ""
Range("D39").Select
ActiveCell.FormulaR1C1 = "0"
Range("D40").Select
ActiveCell.FormulaR1C1 = "0"
Range("H38").Select
ActiveCell.FormulaR1C1 = "1"
Range("A1").Select
'Cristian'
ActiveSheet.Next.Select
Range("C2").Select
ActiveCell.FormulaR1C1 = "0"
Range("C4").Select
ActiveCell.FormulaR1C1 = "0"
Range("C5").Select
ActiveCell.FormulaR1C1 = "0"
Range("C6").Select
ActiveCell.FormulaR1C1 = "0"
Range("C7").Select
ActiveCell.FormulaR1C1 = "0"
Range("C9").Select
ActiveCell.FormulaR1C1 = "0"
Range("C10").Select
ActiveCell.FormulaR1C1 = "0"
Range("F3:G3").Select
ActiveCell.FormulaR1C1 = ""
Range("D13").Select
ActiveCell.FormulaR1C1 = "0"
Range("G18").Select
ActiveCell.FormulaR1C1 = ""
Range("E19:I21").Select
ActiveCell.FormulaR1C1 = ""
Range("D39").Select
ActiveCell.FormulaR1C1 = "0"
Range("D40").Select
ActiveCell.FormulaR1C1 = "0"
Range("H38").Select
ActiveCell.FormulaR1C1 = "1"
Range("A1").Select
'Juancho'
ActiveSheet.Next.Select
Range("C2").Select
ActiveCell.FormulaR1C1 = "0"
Range("C4").Select
ActiveCell.FormulaR1C1 = "0"
Range("C5").Select
ActiveCell.FormulaR1C1 = "0"
Range("C6").Select
ActiveCell.FormulaR1C1 = "0"
Range("C7").Select
ActiveCell.FormulaR1C1 = "0"
Range("C9").Select
ActiveCell.FormulaR1C1 = "0"
Range("C10").Select
ActiveCell.FormulaR1C1 = "0"
Range("F3:G3").Select
ActiveCell.FormulaR1C1 = ""
Range("D13").Select
ActiveCell.FormulaR1C1 = "0"
Range("G18").Select
ActiveCell.FormulaR1C1 = ""
Range("E19:I21").Select
ActiveCell.FormulaR1C1 = ""
Range("D39").Select
ActiveCell.FormulaR1C1 = "0"
Range("D40").Select
ActiveCell.FormulaR1C1 = "0"
Range("H38").Select
ActiveCell.FormulaR1C1 = "1"
Range("A1").Select
'Celcio'
ActiveSheet.Next.Select
Range("C2").Select
ActiveCell.FormulaR1C1 = "0"
Range("C4").Select
ActiveCell.FormulaR1C1 = "0"
Range("C5").Select
ActiveCell.FormulaR1C1 = "0"
Range("C6").Select
ActiveCell.FormulaR1C1 = "0"
Range("C7").Select
ActiveCell.FormulaR1C1 = "0"
Range("C9").Select
ActiveCell.FormulaR1C1 = "0"
Range("C10").Select
ActiveCell.FormulaR1C1 = "0"
Range("F3:G3").Select
ActiveCell.FormulaR1C1 = ""
Range("D13").Select
ActiveCell.FormulaR1C1 = "0"
Range("G18").Select
ActiveCell.FormulaR1C1 = ""
Range("E19:I21").Select
ActiveCell.FormulaR1C1 = ""
Range("D39").Select
ActiveCell.FormulaR1C1 = "0"
Range("D40").Select
ActiveCell.FormulaR1C1 = "0"
Range("H38").Select
ActiveCell.FormulaR1C1 = "1"
Range("A1").Select
'Dudi'
ActiveSheet.Next.Select
Range("C2").Select
ActiveCell.FormulaR1C1 = "0"
Range("C4").Select
ActiveCell.FormulaR1C1 = "0"
Range("C5").Select
ActiveCell.FormulaR1C1 = "0"
Range("C6").Select
ActiveCell.FormulaR1C1 = "0"
Range("C7").Select
ActiveCell.FormulaR1C1 = "0"
Range("C9").Select
ActiveCell.FormulaR1C1 = "0"
Range("C10").Select
ActiveCell.FormulaR1C1 = "0"
Range("F3:G3").Select
ActiveCell.FormulaR1C1 = ""
Range("D13").Select
ActiveCell.FormulaR1C1 = "0"
Range("G18").Select
ActiveCell.FormulaR1C1 = ""
Range("E19:I21").Select
ActiveCell.FormulaR1C1 = ""
Range("D39").Select
ActiveCell.FormulaR1C1 = "0"
Range("D40").Select
ActiveCell.FormulaR1C1 = "0"
Range("H38").Select
ActiveCell.FormulaR1C1 = "1"
Range("A1").Select
'Julio'
ActiveSheet.Next.Select
Range("C2").Select
ActiveCell.FormulaR1C1 = "0"
Range("C4").Select
ActiveCell.FormulaR1C1 = "0"
Range("C5").Select
ActiveCell.FormulaR1C1 = "0"
Range("C6").Select
ActiveCell.FormulaR1C1 = "0"
Range("C7").Select
ActiveCell.FormulaR1C1 = "0"
Range("C9").Select
ActiveCell.FormulaR1C1 = "0"
Range("C10").Select
ActiveCell.FormulaR1C1 = "0"
Range("F3:G3").Select
ActiveCell.FormulaR1C1 = ""
Range("D13").Select
ActiveCell.FormulaR1C1 = "0"
Range("G18").Select
ActiveCell.FormulaR1C1 = ""
Range("E19:I21").Select
ActiveCell.FormulaR1C1 = ""
Range("D39").Select
ActiveCell.FormulaR1C1 = "0"
Range("D40").Select
ActiveCell.FormulaR1C1 = "0"
Range("H38").Select
ActiveCell.FormulaR1C1 = "1"
Range("A1").Select
'Silvia'
ActiveSheet.Next.Select
Range("C2").Select
ActiveCell.FormulaR1C1 = "0"
Range("C4").Select
ActiveCell.FormulaR1C1 = "0"
Range("C5").Select
ActiveCell.FormulaR1C1 = "0"
Range("C6").Select
ActiveCell.FormulaR1C1 = "0"
Range("C7").Select
ActiveCell.FormulaR1C1 = "0"
Range("C9").Select
ActiveCell.FormulaR1C1 = "0"
Range("C10").Select
ActiveCell.FormulaR1C1 = "0"
Range("F3:G3").Select
ActiveCell.FormulaR1C1 = ""
Range("D13").Select
ActiveCell.FormulaR1C1 = "0"
Range("G18").Select
ActiveCell.FormulaR1C1 = ""
Range("E19:I21").Select
ActiveCell.FormulaR1C1 = ""
Range("D39").Select
ActiveCell.FormulaR1C1 = "0"
Range("D40").Select
ActiveCell.FormulaR1C1 = "0"
Range("H38").Select
ActiveCell.FormulaR1C1 = "1"
Range("A1").Select
'Mariano'
ActiveSheet.Next.Select
Range("C2").Select
ActiveCell.FormulaR1C1 = "0"
Range("C4").Select
ActiveCell.FormulaR1C1 = "0"
Range("C5").Select
ActiveCell.FormulaR1C1 = "0"
Range("C6").Select
ActiveCell.FormulaR1C1 = "0"
Range("C7").Select
ActiveCell.FormulaR1C1 = "0"
Range("C9").Select
ActiveCell.FormulaR1C1 = "0"
Range("C10").Select
ActiveCell.FormulaR1C1 = "0"
Range("F3:G3").Select
ActiveCell.FormulaR1C1 = ""
Range("D13").Select
ActiveCell.FormulaR1C1 = "0"
Range("G18").Select
ActiveCell.FormulaR1C1 = ""
Range("E19:I21").Select
ActiveCell.FormulaR1C1 = ""
Range("D39").Select
ActiveCell.FormulaR1C1 = "0"
Range("D40").Select
ActiveCell.FormulaR1C1 = "0"
Range("H38").Select
ActiveCell.FormulaR1C1 = "1"
Range("A1").Select
'Marcio'
ActiveSheet.Next.Select
Range("C2").Select
ActiveCell.FormulaR1C1 = "0"
Range("C4").Select
ActiveCell.FormulaR1C1 = "0"
Range("C5").Select
ActiveCell.FormulaR1C1 = "0"
Range("C6").Select
ActiveCell.FormulaR1C1 = "0"
Range("C7").Select
ActiveCell.FormulaR1C1 = "0"
Range("C9").Select
ActiveCell.FormulaR1C1 = "0"
Range("C10").Select
ActiveCell.FormulaR1C1 = "0"
Range("F3:G3").Select
ActiveCell.FormulaR1C1 = ""
Range("D13").Select
ActiveCell.FormulaR1C1 = "0"
Range("G18").Select
ActiveCell.FormulaR1C1 = ""
Range("E19:I21").Select
ActiveCell.FormulaR1C1 = ""
Range("D39").Select
ActiveCell.FormulaR1C1 = "0"
Range("D40").Select
ActiveCell.FormulaR1C1 = "0"
Range("H38").Select
ActiveCell.FormulaR1C1 = "1"
Range("A1").Select
'Susy'
ActiveSheet.Next.Select
Range("C2").Select
ActiveCell.FormulaR1C1 = "0"
Range("C4").Select
ActiveCell.FormulaR1C1 = "0"
Range("C5").Select
ActiveCell.FormulaR1C1 = "0"
Range("C6").Select
ActiveCell.FormulaR1C1 = "0"
Range("C7").Select
ActiveCell.FormulaR1C1 = "0"
Range("C9").Select
ActiveCell.FormulaR1C1 = "0"
Range("C10").Select
ActiveCell.FormulaR1C1 = "0"
Range("F3:G3").Select
ActiveCell.FormulaR1C1 = ""
Range("D13").Select
ActiveCell.FormulaR1C1 = "0"
Range("G18").Select
ActiveCell.FormulaR1C1 = ""
Range("E19:I21").Select
ActiveCell.FormulaR1C1 = ""
Range("D39").Select
ActiveCell.FormulaR1C1 = "0"
Range("D40").Select
ActiveCell.FormulaR1C1 = "0"
Range("H38").Select
ActiveCell.FormulaR1C1 = "1"
Range("A1").Select
'Daniel'
ActiveSheet.Next.Select
Range("C2").Select
ActiveCell.FormulaR1C1 = "0"
Range("C4").Select
ActiveCell.FormulaR1C1 = "0"
Range("C5").Select
ActiveCell.FormulaR1C1 = "0"
Range("C6").Select
ActiveCell.FormulaR1C1 = "0"
Range("C7").Select
ActiveCell.FormulaR1C1 = "0"
Range("C9").Select
ActiveCell.FormulaR1C1 = "0"
Range("C10").Select
ActiveCell.FormulaR1C1 = "0"
Range("F3:G3").Select
ActiveCell.FormulaR1C1 = ""
Range("D13").Select
ActiveCell.FormulaR1C1 = "0"
Range("G18").Select
ActiveCell.FormulaR1C1 = ""
Range("E19:I21").Select
ActiveCell.FormulaR1C1 = ""
Range("D39").Select
ActiveCell.FormulaR1C1 = "0"
Range("D40").Select
ActiveCell.FormulaR1C1 = "0"
Range("H38").Select
ActiveCell.FormulaR1C1 = "1"
Range("A1").Select
'FIN'
Sheets("General").Select
End Sub
Supongo que hay que hacerlo para todas las hojas excepto la hoja "General". Ejecuta la siguiente macro:
Sub Dejar_En_Cero_V2() 'Por.Dante Amor For Each h In Sheets If h.Name <> "General" Then h.Range("C2, C4, C5, C6, C7, C9, C10, D13, G18, D39, D40") = "0" h.Range("F3:G3, E19:I21") = "" h.Range("H38") = "1" End If Next MsgBox "Fin" End Sub
.
'S aludos. Dante Amor. Recuerda valorar la respuesta. G racias
.
Avísame cualquier duda
.
Quedaría así, pon en esta línea todas las hojas fijas para que no las tome
"General", "Hoja3", "RESUMEN"
Sub Dejar_En_Cero_V2() 'Por.Dante Amor For Each h In Sheets Select Case h.Name Case "General", "Hoja3", "RESUMEN" Case Else h.Range("C2, C4, C5, C6, C7, C9, C10, D13, G18, D39, D40") = "0" h.Range("F3:G3, E19:I21") = "" h.Range("H38") = "1" End Select Next MsgBox "Fin" End Sub
.
'S aludos. Dante Amor. Recuerda valorar la respuesta. G racias
.
Avísame cualquier duda
.
La ultima y ya cierro la pregunta, como hago para hacer al revés, seleccionar todas las hojas que si quiero poner determinada cosa.
Así:
Sub Dejar_En_Cero_V2() 'Por.Dante Amor For Each h In Sheets Select Case h.Name Case "Hoja1", "Hoja2", "Hojax" h.Range("C2, C4, C5, C6, C7, C9, C10, D13, G18, D39, D40") = "0" h.Range("F3:G3, E19:I21") = "" h.Range("H38") = "1" End Select Next MsgBox "Fin" End Sub
Quise abrir otra pregunta pero no me dejo porque dice que es igual.
Necesito otra cosa de la misma macro.
Tengo esta macro:
Sub ValoresComunes() Range("M48:X63").Select Application.CutCopyMode = False Selection.Copy Range("M16:X16").Select Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _ :=False, Transpose:=False Range("A1").Select End Sub
Quiero repetirla como antes y probe de dos maneras:
Sub TodosValoresComunes1() For Each h In Sheets Select Case h.Name Case "Fechas", "General", "Reimpresion", "Aguinaldo", "Resumen", "Base de Datos", "Adelantos" Case Else h.Application.Run "Sueldos.xlsm!ValoresComunes.ValoresComunes" End Select Next End Sub
Sub TodosValoresComunes2() For Each h In Sheets Select Case h.Name Case "Fechas", "General", "Reimpresion", "Aguinaldo", "Resumen", "Base de Datos", "Adelantos" Case Else h.Range("M48:X63").Select Application.CutCopyMode = False Selection.Copy h.Range("M16:X16").Select Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _ :=False, Transpose:=False h.Range("A1").Select End Select Next End Sub
Espero que me diga donde estoy cometiendo el error.
Gracias
- Compartir respuesta