Hi all, got a big ask, been trying to figure it out but getting no where with it
I need to write some vba code that connects to a button, the criteria that i need to implement is as follows:
If value in col H > 0:
- Send cols G:H , AG:BL to one sheet (MANUFACTURE_LIST)
- Send cols AG:AJ, AK:AN, AO:AR, AV:AX, BA:BC, BD:BG, BH:BK to one sheet (CUTTING_LIST_MELAMINE) as a list, adding together the amounts with the same lengths and widths, sorting by largest size first.
- Send cols L,O:P & V,Y:Z to same sheet as above if cols M,W = "Melamine".
- Send cols L,O:P & V,Y:Z to one sheet (CUTTING_LIST_SUPAWOOD) if cols M,W = "Supawood", adding together amounts with same lengths and widths, sorting by largest size first.
- Send cols L,O:P & V,Y:Z to one sheet (CUTTING_LIST_VENEER) if cols M,W = "Veneer", adding together amounts with the same lengths and widths, sorting by largest size first.
i can provide a sharable link to the file if that would make it easier for you
here is the code that ive manage to make work so far
Any help that anyone could provide would greatly appreciated. This spreadsheet has had me pulling my hair out to try and get it working efficiently (There are a lot of other worksheets hidden within this workbook that i have spent a lot of time on to get them right also)
I need to write some vba code that connects to a button, the criteria that i need to implement is as follows:
If value in col H > 0:
- Send cols G:H , AG:BL to one sheet (MANUFACTURE_LIST)
- Send cols AG:AJ, AK:AN, AO:AR, AV:AX, BA:BC, BD:BG, BH:BK to one sheet (CUTTING_LIST_MELAMINE) as a list, adding together the amounts with the same lengths and widths, sorting by largest size first.
- Send cols L,O:P & V,Y:Z to same sheet as above if cols M,W = "Melamine".
- Send cols L,O:P & V,Y:Z to one sheet (CUTTING_LIST_SUPAWOOD) if cols M,W = "Supawood", adding together amounts with same lengths and widths, sorting by largest size first.
- Send cols L,O:P & V,Y:Z to one sheet (CUTTING_LIST_VENEER) if cols M,W = "Veneer", adding together amounts with the same lengths and widths, sorting by largest size first.
i can provide a sharable link to the file if that would make it easier for you
here is the code that ive manage to make work so far
VBA Code:
Private Sub CommandButton1_Click() G = Worksheets("SPEC_SHEET").Cells(Rows.Count, 7).End(xlUp).Row For i = 2 To G If Worksheets("SPEC_SHEET").Cells(i, 8).Value > 0 Then Worksheets("SPEC_SHEET").Rows(i).Copy Worksheets("Sheet1").Activate h = Worksheets("Sheet1").Cells(Rows.Count, 7).End(xlUp).Row Worksheets("Sheet1").Cells(h + 1, 1).Select ActiveSheet.Paste Worksheets("SPEC_SHEET").Activate End If Next Application.CutCopyMode = False ThisWorkbook.Worksheets("SPEC_SHEET").Cells(1, 1).Select End Sub
Any help that anyone could provide would greatly appreciated. This spreadsheet has had me pulling my hair out to try and get it working efficiently (There are a lot of other worksheets hidden within this workbook that i have spent a lot of time on to get them right also)