Hello,
I have a sub routine in which i use two loops. I dont know how to increase the effectiveness of the code. I just want the code to run successfully.
Please Help!!
The arrays are globally initialized.
Sub printtsales()
Excel.Application.Calculation = xlCalculationManual
Dim j, k As Integer
j = 1
k = 1
While k <= 276
While j <= 53
If Not IsEmpty(salesqtya(j, k)) Or Not salesqtya(j, k) = 0 Then
Sheets("Sales").Cells(3 + k, 1 + j).Value = salesqtya(j, k)
End If
If Not IsEmpty(salesvala(j, k)) Or Not salesvala(j, k) = 0 Then
Sheets("Sales").Cells(280 + k, 1 + j).Value = salesvala(j, k)
End If
If Not IsEmpty(salesqtyp(j, k)) Or Not salesqtyp(j, k) = 0 Then
Sheets("SalesP").Cells(3 + k, 1 + j).Value = salesqtyp(j, k)
End If
If Not IsEmpty(salesvalp(j, k)) Or Not salesvalp(j, k) = 0 Then
Sheets("SalesP").Cells(280 + k, 1 + j).Value = salesvalp(j, k)
End If
j = j + 1
Wend
j = 1
k = k + 1
Wend
Excel.Application.Calculation = xlCalculationAutomatic
End Sub
Bookmarks