M
Michael168
How can I simplified the macro below like something using increament
method.
These are just a minor extract only. Please help
sh2.Cells(32, 3).Value = _
Application.WorksheetFunction.CountIf(Range("C1:C30"), 0)
sh2.Cells(33, 3).Value = _
Application.WorksheetFunction.CountIf(Range("C1:C30"), 1)
sh2.Cells(34, 3).Value = _
Application.WorksheetFunction.CountIf(Range("C1:C30"), 2)
sh2.Cells(35, 3).Value = _
Application.WorksheetFunction.CountIf(Range("C1:C30"), 3)
sh2.Cells(32, 5).Value = _
Application.WorksheetFunction.CountIf(Range("E1:E30"), 0)
sh2.Cells(33, 5).Value = _
Application.WorksheetFunction.CountIf(Range("E1:E30"), 1)
sh2.Cells(34, 5).Value = _
Application.WorksheetFunction.CountIf(Range("E1:E30"), 2)
sh2.Cells(35, 5).Value = _
Application.WorksheetFunction.CountIf(Range("E1:E30"), 3)
sh2.Cells(32, 7).Value = _
Application.WorksheetFunction.CountIf(Range("G1:G30"), 0)
sh2.Cells(33, 7).Value = _
Application.WorksheetFunction.CountIf(Range("G1:G30"), 1)
sh2.Cells(34, 7).Value = _
Application.WorksheetFunction.CountIf(Range("G1:G30"), 2)
sh2.Cells(35, 7).Value = _
Application.WorksheetFunction.CountIf(Range("G1:G30"), 3)
sh2.Cells(32, 9).Value = _
Application.WorksheetFunction.CountIf(Range("I1:I30"), 0)
sh2.Cells(33, 9).Value = _
Application.WorksheetFunction.CountIf(Range("I1:I30"), 1)
sh2.Cells(34, 9).Value = _
Application.WorksheetFunction.CountIf(Range("I1:I30"), 2)
sh2.Cells(35, 9).Value = _
Application.WorksheetFunction.CountIf(Range("I1:I30"), 3)
sh2.Cells(32, 11).Value = _
Application.WorksheetFunction.CountIf(Range("K1:K30"), 0)
sh2.Cells(33, 11).Value = _
Application.WorksheetFunction.CountIf(Range("K1:K30"), 1)
sh2.Cells(34, 11).Value = _
Application.WorksheetFunction.CountIf(Range("K1:K30"), 2)
sh2.Cells(35, 11).Value = _
Application.WorksheetFunction.CountIf(Range("K1:K30"), 3)
Thank you.
method.
These are just a minor extract only. Please help
sh2.Cells(32, 3).Value = _
Application.WorksheetFunction.CountIf(Range("C1:C30"), 0)
sh2.Cells(33, 3).Value = _
Application.WorksheetFunction.CountIf(Range("C1:C30"), 1)
sh2.Cells(34, 3).Value = _
Application.WorksheetFunction.CountIf(Range("C1:C30"), 2)
sh2.Cells(35, 3).Value = _
Application.WorksheetFunction.CountIf(Range("C1:C30"), 3)
sh2.Cells(32, 5).Value = _
Application.WorksheetFunction.CountIf(Range("E1:E30"), 0)
sh2.Cells(33, 5).Value = _
Application.WorksheetFunction.CountIf(Range("E1:E30"), 1)
sh2.Cells(34, 5).Value = _
Application.WorksheetFunction.CountIf(Range("E1:E30"), 2)
sh2.Cells(35, 5).Value = _
Application.WorksheetFunction.CountIf(Range("E1:E30"), 3)
sh2.Cells(32, 7).Value = _
Application.WorksheetFunction.CountIf(Range("G1:G30"), 0)
sh2.Cells(33, 7).Value = _
Application.WorksheetFunction.CountIf(Range("G1:G30"), 1)
sh2.Cells(34, 7).Value = _
Application.WorksheetFunction.CountIf(Range("G1:G30"), 2)
sh2.Cells(35, 7).Value = _
Application.WorksheetFunction.CountIf(Range("G1:G30"), 3)
sh2.Cells(32, 9).Value = _
Application.WorksheetFunction.CountIf(Range("I1:I30"), 0)
sh2.Cells(33, 9).Value = _
Application.WorksheetFunction.CountIf(Range("I1:I30"), 1)
sh2.Cells(34, 9).Value = _
Application.WorksheetFunction.CountIf(Range("I1:I30"), 2)
sh2.Cells(35, 9).Value = _
Application.WorksheetFunction.CountIf(Range("I1:I30"), 3)
sh2.Cells(32, 11).Value = _
Application.WorksheetFunction.CountIf(Range("K1:K30"), 0)
sh2.Cells(33, 11).Value = _
Application.WorksheetFunction.CountIf(Range("K1:K30"), 1)
sh2.Cells(34, 11).Value = _
Application.WorksheetFunction.CountIf(Range("K1:K30"), 2)
sh2.Cells(35, 11).Value = _
Application.WorksheetFunction.CountIf(Range("K1:K30"), 3)
Thank you.