Macro se repita
Como puedo hacer que esta macro se repita hasta que no encuntre información que sumar
Sub PruebaEsto()
Selection.End(xlDown).Select
Selection.End(xlDown).Select
Dim Rg As Range
With ActiveCell
Set Rg = Range(.Offset(-1, 0), .Offset(-1, 0).End(xlUp))
.FormulaR1C1 = "=SUM(R[-" & Rg.Rows.Count & "]C:R[-1]C)"
End With
Selection.Copy
Range(Selection, Selection.End(xlToLeft)).Select
ActiveSheet.Paste
Application.CutCopyMode = False
Selection.End(xlUp).Select
Selection.End(xlDown).Select
Selection.End(xlToRight).Select
End Sub
Sub PruebaEsto()
Selection.End(xlDown).Select
Selection.End(xlDown).Select
Dim Rg As Range
With ActiveCell
Set Rg = Range(.Offset(-1, 0), .Offset(-1, 0).End(xlUp))
.FormulaR1C1 = "=SUM(R[-" & Rg.Rows.Count & "]C:R[-1]C)"
End With
Selection.Copy
Range(Selection, Selection.End(xlToLeft)).Select
ActiveSheet.Paste
Application.CutCopyMode = False
Selection.End(xlUp).Select
Selection.End(xlDown).Select
Selection.End(xlToRight).Select
End Sub
1 respuesta
Respuesta de paramisolo
1