Jt13
08-15-2023, 01:18 PM
Hello,
Our company has an inventory list that we select items from for each job. Each item is assigned a "phase" (Travel, Commissioning, Installation, etc.) When it gets assigned a phase, I want to take the second and third column values in that row and have it populate on another sheet under the appropriate phase. So far I can only insert the row on the first unused row. Any help would be appreciated! Code and photos below:
Sub CopyCatalogtoPickSheet()
Dim PartIDField As Range
Dim PartIDCell As Range
Dim Rng As Range
Dim WorkRng As Range
Dim PSSheet As Worksheet
Dim CSheet As Worksheet
Set PSSheet = Worksheets("Material Pick Sheet")
Set CSheet = Worksheets("Catalog")
Set PartIDField = CSheet.Range("A6", CSheet.Range("A6").End(xlDown))
For Each PartIDCell In PartIDField
If PartIDCell.Value = "Module Installation" Then
PartIDCell.Resize(1, 2).Offset(0, 1).Copy Destination:=PSSheet.Range("A1").Offset(PSSheet.Rows.Count - 1, 0).End(xlUp).Offset(1, 0)
End If
Next PartIDCell
PSSheet.Columns.AutoFit
End Sub
30987
30988
Our company has an inventory list that we select items from for each job. Each item is assigned a "phase" (Travel, Commissioning, Installation, etc.) When it gets assigned a phase, I want to take the second and third column values in that row and have it populate on another sheet under the appropriate phase. So far I can only insert the row on the first unused row. Any help would be appreciated! Code and photos below:
Sub CopyCatalogtoPickSheet()
Dim PartIDField As Range
Dim PartIDCell As Range
Dim Rng As Range
Dim WorkRng As Range
Dim PSSheet As Worksheet
Dim CSheet As Worksheet
Set PSSheet = Worksheets("Material Pick Sheet")
Set CSheet = Worksheets("Catalog")
Set PartIDField = CSheet.Range("A6", CSheet.Range("A6").End(xlDown))
For Each PartIDCell In PartIDField
If PartIDCell.Value = "Module Installation" Then
PartIDCell.Resize(1, 2).Offset(0, 1).Copy Destination:=PSSheet.Range("A1").Offset(PSSheet.Rows.Count - 1, 0).End(xlUp).Offset(1, 0)
End If
Next PartIDCell
PSSheet.Columns.AutoFit
End Sub
30987
30988