Hi I have created the following code to autosum a large number of rows of data, around 80000 in total, which is far too slow to do manaually.
The code works fine in terms of a loop and perfectly if you run the insert autosum as a single function outside of the loop. However the two together clash and im not sure how to resolve this. i can leave this running overnight so if it takes a tad longer to do it a different way thats fine.
Can anyone please help me resolve why it jams?
Thanks
Chris
Sub autosumloop()
Do Until ActiveCell = Empty And ActiveCell.Offset(1) = Empty
If ActiveCell = Empty Then
CommandBars.FindControl(ID:=226).Execute
Application.SendKeys ("~")
Application.SendKeys ("~")
Else
ActiveCell.Offset(1).Select
End If
Loop
End Sub
The code works fine in terms of a loop and perfectly if you run the insert autosum as a single function outside of the loop. However the two together clash and im not sure how to resolve this. i can leave this running overnight so if it takes a tad longer to do it a different way thats fine.
Can anyone please help me resolve why it jams?
Thanks
Chris
Sub autosumloop()
Do Until ActiveCell = Empty And ActiveCell.Offset(1) = Empty
If ActiveCell = Empty Then
CommandBars.FindControl(ID:=226).Execute
Application.SendKeys ("~")
Application.SendKeys ("~")
Else
ActiveCell.Offset(1).Select
End If
Loop
End Sub