Macro help

Davesbro

New member
Joined
Mar 14, 2020
Messages
2
Reaction score
0
Points
0
Excel Version(s)
2016
When running this macro I get error. The macro runs all the way down to cell A1048576. I get RunTime error 1004. Application- defined or Object-defined error and highlights ActiveCell.Offset(1, 0).Range("A1").Select.




Code:
Sub Macro2()


    For X = 1 To 50
    ActiveCell.Rows("1:11").EntireRow.Select
    Selection.Delete Shift:=xlUp
    ActiveCell.Select
    Selection.End(xlDown).Select
    ActiveCell.Offset(1, 0).Range("A1").Select
    
    Next X
End Sub
 
Welcome to the forum. :)

Please have a read of our forum rules. I have added code tags for you, but you will need to improve your thread title before any help is offered: please summarise what the problem is.

No help to be offered until the thread title has been improved.
 
and tell us what you're trying to do rather than how you can't do it.

@ AliGW
Does this forum no longer have the its' 10 minute edit limitation ?
 
and tell us what you're trying to do rather than how you can't do it.

The macro is very simple, it deletes the the first 10 rows then moves down to the next blank row then deletes the next 10 rows.The macro works but it runs down to the very last row on the sheet. I do not have the knowledge of VBA at the moment to stop this,
 
Back
Top