Ampliar rango de búsqueda en una macro
Hola. Necesito saber como ampliar el rango de búsqueda en un macro. Ya que la que hice busca y luego hace una autosuma. Pero al terminar e iniciarla nuevamente, sobre escribe las autosumas por que busca sobre las mismas celdas. No se mueve. Gracias. Esta es la macro que uso:
Sub Macro3()
'
' Macro3 Macro
' Macro recorded 1/12/2011 by Administrator
'
' Keyboard Shortcut: Ctrl+q
'
Cells.Find(What:="sueldo ordinario", After:=ActiveCell, LookIn:= _
xlFormulas, LookAt:=xlPart, SearchOrder:=xlByRows, SearchDirection:= _
xlNext, MatchCase:=False, SearchFormat:=False).Activate
Selection.End(xlToRight).Select
Selection.End(xlToRight).Select
Range("O14").Select
ActiveCell.FormulaR1C1 = "=SUM(RC[-12]:RC[-1])"
Range("P14").Select
Cells.Find(What:="bonificacion incent", After:=ActiveCell, LookIn:= _
xlFormulas, LookAt:=xlPart, SearchOrder:=xlByRows, SearchDirection:= _
xlNext, MatchCase:=False, SearchFormat:=False).Activate
Selection.End(xlToRight).Select
Selection.End(xlToRight).Select
Range("O15").Select
ActiveCell.FormulaR1C1 = "=SUM(RC[-12]:RC[-1])"
Range("P15").Select
Cells.Find(What:="bono 14", After:=ActiveCell, LookIn:=xlFormulas, _
LookAt:=xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext, _
MatchCase:=False, SearchFormat:=False).Activate
Selection.End(xlToRight).Select
Selection.End(xlToRight).Select
Range("O16").Select
ActiveCell.FormulaR1C1 = "=SUM(RC[-12]:RC[-1])"
Range("P16").Select
Cells.Find(What:="aguinaldo", After:=ActiveCell, LookIn:=xlFormulas, _
LookAt:=xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext, _
MatchCase:=False, SearchFormat:=False).Activate
Selection.End(xlToRight).Select
Selection.End(xlToRight).Select
Range("O17").Select
ActiveCell.FormulaR1C1 = "=SUM(RC[-12]:RC[-1])"
Range("O18").Select
End Sub
Sub Macro3()
'
' Macro3 Macro
' Macro recorded 1/12/2011 by Administrator
'
' Keyboard Shortcut: Ctrl+q
'
Cells.Find(What:="sueldo ordinario", After:=ActiveCell, LookIn:= _
xlFormulas, LookAt:=xlPart, SearchOrder:=xlByRows, SearchDirection:= _
xlNext, MatchCase:=False, SearchFormat:=False).Activate
Selection.End(xlToRight).Select
Selection.End(xlToRight).Select
Range("O14").Select
ActiveCell.FormulaR1C1 = "=SUM(RC[-12]:RC[-1])"
Range("P14").Select
Cells.Find(What:="bonificacion incent", After:=ActiveCell, LookIn:= _
xlFormulas, LookAt:=xlPart, SearchOrder:=xlByRows, SearchDirection:= _
xlNext, MatchCase:=False, SearchFormat:=False).Activate
Selection.End(xlToRight).Select
Selection.End(xlToRight).Select
Range("O15").Select
ActiveCell.FormulaR1C1 = "=SUM(RC[-12]:RC[-1])"
Range("P15").Select
Cells.Find(What:="bono 14", After:=ActiveCell, LookIn:=xlFormulas, _
LookAt:=xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext, _
MatchCase:=False, SearchFormat:=False).Activate
Selection.End(xlToRight).Select
Selection.End(xlToRight).Select
Range("O16").Select
ActiveCell.FormulaR1C1 = "=SUM(RC[-12]:RC[-1])"
Range("P16").Select
Cells.Find(What:="aguinaldo", After:=ActiveCell, LookIn:=xlFormulas, _
LookAt:=xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext, _
MatchCase:=False, SearchFormat:=False).Activate
Selection.End(xlToRight).Select
Selection.End(xlToRight).Select
Range("O17").Select
ActiveCell.FormulaR1C1 = "=SUM(RC[-12]:RC[-1])"
Range("O18").Select
End Sub
1 Respuesta
Respuesta de Elsa Matilde
1