I have this block of code that takes more than five seconds to run, appreciate any insights in making this work faster
Code:
With Worksheets("Country-Product Report")
If Worksheets("raw2").Range("H" & chrw) <> 0 Then
shr = Worksheets("raw2").Range("E" & chrw) / Worksheets("raw2").Range("H" & chrw)
End If
Range("E" & rw).Value = Worksheets("raw2").Range("E" & chrw).Value 'Product
Range("F" & rw).Value = Worksheets("raw2").Range("H" & chrw).Value 'Market
Range("G" & rw).Value = shr 'Market Share
Range("H" & rw).Value = Worksheets("raw2").Range("Q" & chrw).Value 'EI
Range("I" & rw).Value = Worksheets("raw2").Range("T" & chrw).Value 'Growth
Range("J" & rw).Value = Worksheets("raw2").Range("W" & chrw).Value 'Mkt Growth
End With
'Put in YTD values
With Worksheets("Country-Product Report")
If Worksheets("raw2").Range("J" & chrw) <> 0 Then
shr = Worksheets("raw2").Range("G" & chrw) / Worksheets("raw2").Range("J" & chrw)
End If
Range("K" & rw).Value = Worksheets("raw2").Range("G" & chrw).Value 'Product
Range("L" & rw).Value = Worksheets("raw2").Range("J" & chrw).Value 'Market
Range("M" & rw).Value = shr 'Market Share
Range("N" & rw).Value = Worksheets("raw2").Range("S" & chrw).Value 'EI
Range("O" & rw).Value = Worksheets("raw2").Range("V" & chrw).Value 'Growth
Range("P" & rw).Value = Worksheets("raw2").Range("Y" & chrw).Value 'Mkt Growth
End With
'Put in MAT values
With Worksheets("Country-Product Report")
If Worksheets("raw2").Range("I" & chrw) <> 0 Then
shr = Worksheets("raw2").Range("F" & chrw) / Worksheets("raw2").Range("I" & chrw)
End If
Range("Q" & rw).Value = Worksheets("raw2").Range("F" & chrw).Value 'Product
Range("R" & rw).Value = Worksheets("raw2").Range("I" & chrw).Value 'Market
Range("S" & rw).Value = shr 'Market Share
Range("T" & rw).Value = Worksheets("raw2").Range("R" & chrw).Value 'EI
Range("U" & rw).Value = Worksheets("raw2").Range("U" & chrw).Value 'Growth
Range("V" & rw).Value = Worksheets("raw2").Range("X" & chrw).Value 'Mkt Growth
End With