So some of you have already helped tremendously on this project, and it turned out great! I tested it live and I think I need to make a few changes as I found a few flaws in the design. And I am looking for some help. For example I have 3 main sheets (technically 7 as there is 5 days in the week.) But for all intensive purposes I have 3 sheets, ws1 = "Parts Master", ws2 = "Parts Order list", ws3 = "Monday". As it stands now I have the following code that runs on each day of the weeks sheet.
As you can see, When data is entered in (D6:D30) on "ws3" the code finds the corresponding part number in the "ws1" and pastes the row into the next available row on "ws2". What I would like to change is when data is entered in "D6" on ws1 (first row of data on "Monday") it does the exact same thing but is only attached to Row 2 in "ws2" (first row of data in "Parts order list"). It still finds the data in "ws1" but I want "D6" on "ws3" and Row 2 in "ws2" to be together. this way if someone makes a mistake when they are entering data it only affects that one row. And can be easily fixed without having to erase all of the other data that has been entered. Then of course Move onto "D7" ws3 and row 3 "ws2". and all the way down to "D30" "ws3" and Row 26 "ws2" and I am hoping there is a way to do this. If someone can, please help me. I think this will take my workbook over the top and will be the best it can possibly be! If you have any questions please feel free to ask. I tried to make it as clear as possible. Somethings I feel like I don't do a very good job of that lol...
Code:
Private Sub Worksheet_Change(ByVal Target As Range)Dim LastRow As Long
Dim Rng As Range, Found As Range
Dim ws1 As Worksheet, ws2 As Worksheet, ws3 As Worksheet
Set ws1 = Sheets("Parts Order list")
Set ws2 = Sheets("Parts Master")
Set ws3 = Sheets("Monday")
LastRow = ws2.Cells(Rows.Count, "A").End(xlUp).Row
Set Rng = ws2.Range("A2:A" & LastRow)
If Not Intersect(Target, ws3.Range("D6:D30")) Is Nothing Then
Set Found = Rng.Find(what:=Target.Value, LookIn:=xlValues)
If Not Found Is Nothing Then
ws1.Range("B" & Rows.Count).End(xlUp).Offset(1).Resize(, 21).Value = Found.Resize(, 21).Value
End If
End If
End Sub
As you can see, When data is entered in (D6:D30) on "ws3" the code finds the corresponding part number in the "ws1" and pastes the row into the next available row on "ws2". What I would like to change is when data is entered in "D6" on ws1 (first row of data on "Monday") it does the exact same thing but is only attached to Row 2 in "ws2" (first row of data in "Parts order list"). It still finds the data in "ws1" but I want "D6" on "ws3" and Row 2 in "ws2" to be together. this way if someone makes a mistake when they are entering data it only affects that one row. And can be easily fixed without having to erase all of the other data that has been entered. Then of course Move onto "D7" ws3 and row 3 "ws2". and all the way down to "D30" "ws3" and Row 26 "ws2" and I am hoping there is a way to do this. If someone can, please help me. I think this will take my workbook over the top and will be the best it can possibly be! If you have any questions please feel free to ask. I tried to make it as clear as possible. Somethings I feel like I don't do a very good job of that lol...
Last edited: