Error 1004 and I can't figure it out

DondaB

New member
Local time
Yesterday, 20:09
Joined
Jul 30, 2012
Messages
1
I'm trying to run a Macro that checks one column against another. If they're the same, move along to next line. If Column A is greater than C, cut the selected range and move down one line. If Column A is less than C, bring the selected range up one line until Column A and C match. With literally hundreds of thousands of lines to check, this Macro would be ideal... if only it worked!

Sub MoveDown()
If ActiveCell("A2").Value = ActiveCell("C2").Value Then
ActiveCell.Offset(2, 0).Range("A1").Select
End If

If ActiveCell("A2").Value > ActiveCell("C2").Value Then
Range(Selection, ActiveCell.SpecialCells(xlLastCell)).Select
ActiveCell.Range("A1:B47725").Select
Selection.Cut
ActiveCell.Offset(1, 0).Range("A1").Select
ActiveSheet.Paste
ActiveCell.Offset(-2, 0).Range("A1:B2").Select
Selection.FillDown
ActiveCell.Offset(2, 0).Range("A1").Select
End If

If ActiveCell("A2").Value < ActiveCell("C2").Value Then
ActiveCell.Range("A1:B1").Select
Selection.ClearContents
ActiveCell.Offset(1, 0).Range("A1:B1").Select
Range(Selection, ActiveCell.SpecialCells(xlLastCell)).Select
ActiveCell.Range("A1:B47724").Select
Selection.Cut
ActiveCell.Offset(-1, 0).Range("A1").Select
ActiveSheet.Paste
ActiveCell.Offset(1, 0).Range("A1").Select
End If

End Sub


Any ideas? I'm turning Gray by the second!:banghead:
 

Users who are viewing this thread

Back
Top Bottom