What am I missing? This code executes fine moving the data as needed … but loops endlessly …
I’d appreciate any suggestions from someone with more expertise than I have. Thanks in advance.
Sub ReorganizeData()
‘A Routine that evaluates the point range
‘then copies the data to another workseet
Dim Count as Integer
Do while ActiveCell “”
If ActiveCell <= 10 Then
count = 1
Do While ActiveCell <= 10
ActiveCell.Offset(0, 1).Range("A1").Select
Selection.Copy
Sheets("Sheet1").Select
Range("B1").Select
ActiveCell.End (xlDown).Select
ActiveCell.Offset(Count,0).Range("A1").Select
ActiveSheet.Paste
Count = Count + 1
Sheets("Macro Testing").Select
ActiveCell.Offset(1, -1).Range("A1").Select
Loop
ElseIf ActiveCell <= 20 Then
Count = 1
Do While ActiveCell <= 20
ActiveCell.Offset(0, 1).Range("A1").Select
Selection.Copy
Sheets("Sheet1").Select
Range("C1").Select
ActiveCell.End (xlDown).Select
ActiveCell.Offset(Count,0).Range("A1").Select
ActiveSheet.Paste
Count = Count + 1
Sheets("Macro Testing").Select
ActiveCell.Offset(1, -1).Range("A1").Select
Loop
ElseIf ActiveCell <= 30 Then
Count = 1
Do While ActiveCell <= 30
ActiveCell.Offset(0, 1).Range("A1").Select
Selection.Copy
Sheets("Sheet1").Select
Range("D1").Select
ActiveCell.End (xlDown).Select
ActiveCell.Offset(Count,0).Range("A1").Select
ActiveSheet.Paste
Count = Count + 1
Sheets("Macro Testing").Select
ActiveCell.Offset(1, -1).Range("A1").Select
Loop
ElseIf ActiveCell <= 40 Then
Count = 1
Do While ActiveCell <= 40
ActiveCell.Offset(0, 1).Range("A1").Select
Selection.Copy
Sheets("Sheet1").Select
Range("D1").Select
ActiveCell.End (xlDown).Select
ActiveCell.Offset(Count,0).Range("A1").Select
ActiveSheet.Paste
Count = Count + 1
Sheets("Macro Testing").Select
ActiveCell.Offset(1, -1).Range("A1").Select
Loop
'etc. etc. etc. There will be more
End If
Loop
End Sub
Again …. thank you in advance for your expertise.