The title says most of it what I am looking to create is an inventory management system to handle the inventory for my area but I keep getting runtime errors in my code, I am not super proficient at VBA but I have a base knowledge. Code I am working on is below, any help would be awesome.
Edit: Specific runtime error is 1004: Select Method of Range class failed on line 15 after is has already copy and pasted one.
Sub add2Order()
Application.Calculation = xlCalculationManual
Application.EnableEvents = False
Application.ScreenUpdating = False
Dim C As range, Rng As range, D As range, Rng1 As range
Set Rng = range("K6", range("K6").End(xlDown))
For Each C In Rng
If InStr(1, C, "X") > 0 Then
'first select material number and name
range(C.Offset(0, -9), C.Offset(0, -8)).Select
Application.CutCopyMode = False
Selection.Copy
'paste in reorder sheet
Sheets("Re-Order List").Select
Selection.End(xlDown).Select
range("A65536").Select
Selection.End(xlUp).Offset(1, 0).Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Application.CutCopyMode = True
End If
Next
Set Rng1 = range("K6", range("K6").End(xlDown))
For Each D In Rng1
If InStr(1, D, "X") > 0 Then
'Second select amount and cost
range(D.Offset(0, -2), D.Offset(0, -1)).Select
Application.CutCopyMode = False
Selection.Copy
'paste in reorder sheet
Sheets("Re-Order List").Select
Selection.End(xlDown).Select
range("C65536").Select
Selection.End(xlUp).Offset(1, 0).Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Application.CutCopyMode = True
End If
Next
Application.Calculation = xlCalculationAutomatic
Application.ScreenUpdating = True
Application.EnableEvents = True
End Sub