Kyle Johnson2 said:Here is the second part of the code, picking up right where the first bit left off.
Code:Range("D20").Select
Selection.Copy
Range("D21").Select
Selection.PasteSpecial paste : = xlPasteFormulas, Operation:=xlNone, _
SkipBlanks:=False, Transpose:=False
Range("C21").Select
ActiveCell.FormulaR1C1 = "5"
Range("D21").Select
Selection.Copy
Range("D22").Select
Selection.PasteSpecial paste : = xlPasteFormulas, Operation:=xlNone, _
SkipBlanks:=False, Transpose:=False
Range("C22").Select
ActiveCell.FormulaR1C1 = "17"
Range("D22").Select
Selection.Copy
Range("D23").Select
Selection.PasteSpecial paste : = xlPasteFormulas, Operation:=xlNone, _
SkipBlanks:=False, Transpose:=False
Range("C23").Select
ActiveCell.FormulaR1C1 = "19"
Range("D23").Select
Selection.Copy
Range("D24").Select
Selection.PasteSpecial paste : = xlPasteFormulas, Operation:=xlNone, _
SkipBlanks:=False, Transpose:=False
Range("C24").Select
ActiveCell.FormulaR1C1 = "14"
Range("D24").Select
Selection.Copy
Range("D25").Select
Selection.PasteSpecial paste : = xlPasteFormulas, Operation:=xlNone, _
SkipBlanks:=False, Transpose:=False
Range("C25").Select
ActiveCell.FormulaR1C1 = "12"
Range("D25").Select
Selection.Copy
Range("D26").Select
Selection.PasteSpecial paste : = xlPasteFormulas, Operation:=xlNone, _
SkipBlanks:=False, Transpose:=False
Range("C26").Select
ActiveCell.FormulaR1C1 = "11"
Range("D26").Select
Selection.Copy
Range("D27").Select
Selection.PasteSpecial paste : = xlPasteFormulas, Operation:=xlNone, _
SkipBlanks:=False, Transpose:=False
Range("C27").Select
ActiveCell.FormulaR1C1 = "24"
Range("D27").Select
Selection.Copy
Range("D28").Select
Selection.PasteSpecial paste : = xlPasteFormulas, Operation:=xlNone, _
SkipBlanks:=False, Transpose:=False
Range("C28").Select
ActiveCell.FormulaR1C1 = "20"
Range("D28").Select
Selection.Copy
Range("D29").Select
Selection.PasteSpecial paste : = xlPasteFormulas, Operation:=xlNone, _
SkipBlanks:=False, Transpose:=False
Range("C29").Select
ActiveCell.FormulaR1C1 = "4"
Range("D29").Select
Selection.Copy
Range("D30").Select
Selection.PasteSpecial paste : = xlPasteFormulas, Operation:=xlNone, _
SkipBlanks:=False, Transpose:=False
Range("C30").Select
ActiveCell.FormulaR1C1 = "11"
Range("C31").Select
select ActiveWindow.SmallScroll down : = -18 range
Range("D2").Select
ActiveCell.FormulaR1C1 = "=IF(RC[-1]>0,VLOOKUP(RC[-1],R1C6:R6C7,2,TRUE),"""")"
Range("D2").Select
Selection.AutoFill Destination : = range("D2:D30"), Type:=xlFillDefault
Range("D2:D30").Select
Range("A1:D30").Select
Selection.Borders(xlDiagonalDown).LineStyle = xlNone Selection
Selection.Borders(xlDiagonalUp).LineStyle = xlNone
With Selection.Borders(xlEdgeLeft)
.LineStyle = xlContinuous
.ColorIndex = 0
.TintAndShade = 0
.Weight = xlThin
End With
With Selection.Borders(xlEdgeTop)
.LineStyle = xlContinuous
.ColorIndex = 0
.TintAndShade = 0
.Weight = xlThin
End With
With Selection.Borders(xlEdgeBottom)
.LineStyle = xlContinuous
.ColorIndex = 0
.TintAndShade = 0
.Weight = xlThin
End With
With Selection.Borders(xlEdgeRight)
.LineStyle = xlContinuous
.ColorIndex = 0
.TintAndShade = 0
.Weight = xlThin
End With
With Selection.Borders(xlInsideVertical)
.LineStyle = xlContinuous
.ColorIndex = 0
.TintAndShade = 0
.Weight = xlThin
End With
With Selection.Borders(xlInsideHorizontal)
.LineStyle = xlContinuous
.ColorIndex = 0
.TintAndShade = 0
.Weight = xlThin
End With
Range("F1:G6").Select
Selection.Borders(xlDiagonalDown).LineStyle = xlNone Selection
Selection.Borders(xlDiagonalUp).LineStyle = xlNone
With Selection.Borders(xlEdgeLeft)
.LineStyle = xlContinuous
.ColorIndex = 0
.TintAndShade = 0
.Weight = xlThin
End With
With Selection.Borders(xlEdgeTop)
.LineStyle = xlContinuous
.ColorIndex = 0
.TintAndShade = 0
.Weight = xlThin
End With
With Selection.Borders(xlEdgeBottom)
.LineStyle = xlContinuous
.ColorIndex = 0
.TintAndShade = 0
.Weight = xlThin
End With
With Selection.Borders(xlEdgeRight)
.LineStyle = xlContinuous
.ColorIndex = 0
.TintAndShade = 0
.Weight = xlThin
End With
With Selection.Borders(xlInsideVertical)
.LineStyle = xlContinuous
.ColorIndex = 0
.TintAndShade = 0
.Weight = xlThin
End With
With Selection.Borders(xlInsideHorizontal)
.LineStyle = xlContinuous
.ColorIndex = 0
.TintAndShade = 0
.Weight = xlThin
End With
Range("J2").Select
ActiveCell.FormulaR1C1 = "=COUNTIF(R2C4:R39C4,R[-1]C)"
Range("J2").Select
Selection.AutoFill Destination : = range("J2:M2"), Type:=xlFillDefault
Range("J2:M2").Select
Range("A1:D30").Select
Selection.Copy
Sheets("Sheet2").Select
Range("A1").Select
Selection.PasteSpecial paste := xlPasteValues, Operation:=xlNone, SkipBlanks _
:=True, Transpose:=False
Range("A1:D1").Select
Application.CutCopyMode = False
Selection.AutoFilter
ActiveSheet.Range("$A$1:$D$30").AutoFilter Field:=4, Criteria1:=Array("2", _
"3", "4", "5"), Operator:=xlFilterValues
End Sub
is the "program" I think would handle the task, at least in my estimation
THANKS 🙂 works .. though I managed to pull it off without a Macro by using an IF function 🙂 ahh this Excel.. just hoping to get a passing grade 🙂 fingers crossed


