Engalpengal
New Member
- Joined
- May 10, 2023
- Messages
- 43
- Office Version
- 365
- Platform
- Windows
Hello again
First of all, I want to use this opportunity to thank you all here Mr. Excel for the help I have received from you in previous posts.
The work you have put in to it has been invaluable.
I have learned so much, but still have a lot more left to learn
My main goal is to make a process planning system
So the next obstacle is marked in blue:
Sub Copy_ord_fromPL()
Dim oRdre As Variant
Dim pL As Variant
Dim cR1 As String '-------------------------------------------------- Text only
Dim copyFr As Variant '--------------------------------------------- Numbers and text
Dim pDest As Variant '---------------------------------------------- Numbers and text
Set oRdre = Workbooks("Ordre-Spor.xlsm").Sheets("Ordre") '---- Set Workbook for search area
Set pL = ThisWorkbook.Sheets("Plate_copy.xlsm") '--------------- Set Workbook for paste area
Set cRl = oRdre.Range("AK13:BC5000") '--------------------------- Set area for Criteria
Set copyFr = oRdre.Range("C13:P25000") '------------------------ Set search and copy range/area
Set pDest = pL.Range("C67:P5000") '------------------------------ Set paste range/area
Set mPL = oRdre.Range("AK11:AO11") '-------------------------- Set area for key cells, to match in range "kR1area"
Application.ScreenUpdating = False
Action:
Search in "cR1" for rows that match with info given in "mPL" (minimum one col match)
If true (can be more than one rowmatch), copy value C:P
Paste in area "pDest", first available row
Application.ScreenUpdating = True
End Sub
Explanation pictures
Pic 1 - "oRdre.jpg"
Here is a list of products. Further down the row you will find a "process-descriprion" (see pic 2).
Pic 2 - "cR1-and-mPL.jpg"
Cells AK11:AT11 is a process description
Every product line has a separately process setup
0 means that the product isnt suppose to go through that spesific process, and therefore the product shall not be copied
If the product should go through a sesofic process, the column for that spesific prosess will be marked with the process name. This product must be copied.
If the product has been through that process, the column is marked with a green "v", and therefore the product shall not be copied
Pic 3 - "pL.jpg"
Paste area for products that are ready for process starting with "PL"
Hope that this explanation is understandable and that it is possible to program
First of all, I want to use this opportunity to thank you all here Mr. Excel for the help I have received from you in previous posts.
The work you have put in to it has been invaluable.
I have learned so much, but still have a lot more left to learn
My main goal is to make a process planning system
So the next obstacle is marked in blue:
Sub Copy_ord_fromPL()
Dim oRdre As Variant
Dim pL As Variant
Dim cR1 As String '-------------------------------------------------- Text only
Dim copyFr As Variant '--------------------------------------------- Numbers and text
Dim pDest As Variant '---------------------------------------------- Numbers and text
Set oRdre = Workbooks("Ordre-Spor.xlsm").Sheets("Ordre") '---- Set Workbook for search area
Set pL = ThisWorkbook.Sheets("Plate_copy.xlsm") '--------------- Set Workbook for paste area
Set cRl = oRdre.Range("AK13:BC5000") '--------------------------- Set area for Criteria
Set copyFr = oRdre.Range("C13:P25000") '------------------------ Set search and copy range/area
Set pDest = pL.Range("C67:P5000") '------------------------------ Set paste range/area
Set mPL = oRdre.Range("AK11:AO11") '-------------------------- Set area for key cells, to match in range "kR1area"
Application.ScreenUpdating = False
Action:
Search in "cR1" for rows that match with info given in "mPL" (minimum one col match)
If true (can be more than one rowmatch), copy value C:P
Paste in area "pDest", first available row
Application.ScreenUpdating = True
End Sub
Explanation pictures
Pic 1 - "oRdre.jpg"
Here is a list of products. Further down the row you will find a "process-descriprion" (see pic 2).
Pic 2 - "cR1-and-mPL.jpg"
Cells AK11:AT11 is a process description
Every product line has a separately process setup
0 means that the product isnt suppose to go through that spesific process, and therefore the product shall not be copied
If the product should go through a sesofic process, the column for that spesific prosess will be marked with the process name. This product must be copied.
If the product has been through that process, the column is marked with a green "v", and therefore the product shall not be copied
Pic 3 - "pL.jpg"
Paste area for products that are ready for process starting with "PL"
Hope that this explanation is understandable and that it is possible to program
Attachments
Last edited: