Below is my code, but when I execute it takes long time. I need to optimize it so that it takes less processing time.
Sub RFQ()
Dim j As Integer
Dim irow As Integer
Dim v As Integer
Dim s As Integer
Application.ScreenUpdating = False
j = 3
irow = 15
s = 1
v = Worksheets("MML").Cells(irow, 21).Value
Do
If v > 0 Then
Worksheets("RFQ").Cells(j, 10).Value = Worksheets("MML").Cells(irow, 15).Value 'Qty 5
Worksheets("RFQ").Cells(j, 9).Value = Worksheets("MML").Cells(irow, 14).Value 'Qty 4
Worksheets("RFQ").Cells(j, 8).Value = Worksheets("MML").Cells(irow, 13).Value 'Qty 3
Worksheets("RFQ").Cells(j, 7).Value = Worksheets("MML").Cells(irow, 12).Value 'Qty 2
Worksheets("RFQ").Cells(j, 6).Value = Worksheets("MML").Cells(irow, 11).Value 'Qty 1
Worksheets("RFQ").Cells(j, 5).Value = Worksheets("MML").Cells(irow, 10).Value 'Category
Worksheets("RFQ").Cells(j, 4).Value = Worksheets("MML").Cells(irow, 9).Value 'Description
Worksheets("RFQ").Cells(j, 3).Value = Worksheets("MML").Cells(irow, 8).Value 'P/n.
Worksheets("RFQ").Cells(j, 2).Value = s 'sr. no.
irow = irow + 1
j = j + 1
s = s + 1
v = Worksheets("MML").Cells(irow, 11).Value
Else
irow = irow + 1
v = Worksheets("MML").Cells(irow, 11).Value
End If
Loop Until IsEmpty(Worksheets("MML").Cells(irow, 11))
End Sub
Bookmarks