Greetings all you special people, I am aware that this question may have been answered in some way before, but not entirely to my particular challenge.
I have 2 worksheets in a workbook named "Cabinets" and "Hardware". Thank you so very much, In Advance. I need to do the following....
1. Copy from Sheet “Cabinets” AK2:AL1000 and Paste to Sheets “Hardware” A9 after removing duplicates.
2. Find each occurrence of A9 Sheets “Hardware” in the “Cabinets” Column AK and when found, sum the qty and insert the total into Sheets “Hardware”C9
Find each occurrence of A10 Sheets “Hardware” in the “Cabinets” Column AK and when found, sum the qty and insert the total into Sheets “Hardware”C10
Do this until there is no data in Col A
3. Find the first occurrence of A9 Sheets “Hardware” in the “Cabinets” Column AK and when found, copy qty in Col AM and insert into Sheets “Hardware”D9. (Cost)
4. Multiply D9 with C9 and insert the answer in F9
Multiply D10 with C10 and insert the answer in F10
Multiply D11 with C11 and insert the answer in F11
Do this until there is no data in Col A
This is what I have cobbled together so far,
Application.Goto Reference:="BuyOuts"
ActiveWorkbook.Worksheets("Cabinets").Sort.SortFields.Clear
ActiveWorkbook.Worksheets("Cabinets").Sort.SortFields.Add2 Key:=Range( _
"AK2:AK1000"), SortOn:=xlSortOnValues, Order:=xlAscending, DataOption:= _
xlSortNormal
With ActiveWorkbook.Worksheets("Cabinets").Sort
.SetRange Range("AK1:BB1000")
.Header = xlYes
.MatchCase = False
.Orientation = xlTopToBottom
.SortMethod = xlPinYin
.Apply
End With
Application.Goto Reference:="Code_Item"
Selection.Copy
Sheets("Hardware").Select
Range("A8").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Application.CutCopyMode = False
ActiveSheet.Range("$A$8:$B$1007").RemoveDuplicates Columns:=Array(1, 2), _
Header:=xlYes
Sheets("Cabinets").Select
Range("AK2:AN2").Select
Selection.Copy
Sheets("Hardware").Select
Range("A9").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
End If
End Sub
I have 2 worksheets in a workbook named "Cabinets" and "Hardware". Thank you so very much, In Advance. I need to do the following....
1. Copy from Sheet “Cabinets” AK2:AL1000 and Paste to Sheets “Hardware” A9 after removing duplicates.
2. Find each occurrence of A9 Sheets “Hardware” in the “Cabinets” Column AK and when found, sum the qty and insert the total into Sheets “Hardware”C9
Find each occurrence of A10 Sheets “Hardware” in the “Cabinets” Column AK and when found, sum the qty and insert the total into Sheets “Hardware”C10
Do this until there is no data in Col A
3. Find the first occurrence of A9 Sheets “Hardware” in the “Cabinets” Column AK and when found, copy qty in Col AM and insert into Sheets “Hardware”D9. (Cost)
4. Multiply D9 with C9 and insert the answer in F9
Multiply D10 with C10 and insert the answer in F10
Multiply D11 with C11 and insert the answer in F11
Do this until there is no data in Col A
This is what I have cobbled together so far,
Application.Goto Reference:="BuyOuts"
ActiveWorkbook.Worksheets("Cabinets").Sort.SortFields.Clear
ActiveWorkbook.Worksheets("Cabinets").Sort.SortFields.Add2 Key:=Range( _
"AK2:AK1000"), SortOn:=xlSortOnValues, Order:=xlAscending, DataOption:= _
xlSortNormal
With ActiveWorkbook.Worksheets("Cabinets").Sort
.SetRange Range("AK1:BB1000")
.Header = xlYes
.MatchCase = False
.Orientation = xlTopToBottom
.SortMethod = xlPinYin
.Apply
End With
Application.Goto Reference:="Code_Item"
Selection.Copy
Sheets("Hardware").Select
Range("A8").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Application.CutCopyMode = False
ActiveSheet.Range("$A$8:$B$1007").RemoveDuplicates Columns:=Array(1, 2), _
Header:=xlYes
Sheets("Cabinets").Select
Range("AK2:AN2").Select
Selection.Copy
Sheets("Hardware").Select
Range("A9").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
End If
End Sub