Davealot
Member
Greetings,
I apologize for asking another question to the forum, but I am very appreciative of all of the help I've received thus far. I'm in need of sorting a set of parts out, I've wrote code that is done incorrectly and I can't figure out what's wrong, specifically I am not sure how to have it offset on sheet 2 when a value is posted, I would like for the code to inspect each cell in Column A until it is empty, and if the first 5 numbers are <= 76249 to place on Sheet 2 starting in column A and if it is >= 76250 then to paste them on sheet 2 starting in column G. I've attached spreadsheet as well as Code that I wrote that fails like a champ. Any help would be greatly appreciate, and again thank you.
I'f you'll notice I haven't even bothered with the ">=76250" as I can't even get the first part to work. Thank you.
I apologize for asking another question to the forum, but I am very appreciative of all of the help I've received thus far. I'm in need of sorting a set of parts out, I've wrote code that is done incorrectly and I can't figure out what's wrong, specifically I am not sure how to have it offset on sheet 2 when a value is posted, I would like for the code to inspect each cell in Column A until it is empty, and if the first 5 numbers are <= 76249 to place on Sheet 2 starting in column A and if it is >= 76250 then to paste them on sheet 2 starting in column G. I've attached spreadsheet as well as Code that I wrote that fails like a champ. Any help would be greatly appreciate, and again thank you.
Code:
Sheets.Add After:=ActiveSheet
Sheets("Sheet1").Select
Range("A2").Select
Do Until IsEmpty(ActiveCell)
If Left(ActiveCell, 5) <= "76249" Then
Range("A2:E2").Select
Selection.Copy
Sheets("Sheet2").Select
ActiveSheet.Paste
Range("A:E").Select
Selection.Delete Shift:=xlUp
Range("A:E").Select
Else
ActiveCell.Offset(1, 0).Select
End If
Loop
End Sub
I'f you'll notice I haven't even bothered with the ">=76250" as I can't even get the first part to work. Thank you.