Good night i got a troublesome workbook because it got some lines that say #NAME? and its value is =-TRA. In my code, i would like to skip those cells so the code continues to run. My code is this and i have a comment marked on the spot the label should go:
Everything else is fine cause i tested it under debug.
Could you help me with that label thing?
Thank you very much!
Code:
Sub OrganizacionParrillaind()
Application.Calculation = xlManual
Application.ScreenUpdating = False
Dim SKU(1 To 21) As Long, c1 As Integer, c2 As Integer, c3 As Integer, c4 As Integer
Dim c5 As Integer, c6 As Integer, pedido(1 To 21, 1 To 163) As Integer
SKU(1) = 244616
SKU(2) = 244640
SKU(3) = 244657
SKU(4) = 244665
SKU(5) = 244681
SKU(6) = 950190
SKU(7) = 950541
SKU(8) = 950558
SKU(9) = 950732
SKU(10) = 2394053
SKU(11) = 2974743
SKU(12) = 3113141
SKU(13) = 3141113
SKU(14) = 3141151
SKU(15) = 3141175
SKU(16) = 3141182
SKU(17) = 3276549
SKU(18) = 3276556
SKU(19) = 4546832
SKU(20) = 4546849
SKU(21) = 4546887
Sheets(3).Activate
c3 = 165
For c1 = 1 To 21
For c2 = 1 To 163
pedido(c1, c2) = Cells(c3, 3).Value
c3 = c3 + 1
Next c2
Next c1
DoEvents
For c1 = 1 To 21
For c2 = 1 To 2
Sheets(c2).Activate
For c3 = 1 To 1390
For c4 = 1 To 50
Cells(c3, c4).Activate
If Cells(c3, c4).Value = SKU(c1) Then
c5 = 0
For c6 = 1 To 160
If Left(Cells(c3 + c5 + c6 + 3, 2).Value, 4) = "1049" _
Or Left(Cells(c3 + c5 + c6 + 3, 2).Value, 4) = "1182" _
Or Left(Cells(c3 + c5 + c6 + 3, 2).Value, 4) = "1197" Then
c5 = c5 + 1
End If
Cells(c3 + c5 + c6 + 3, c4 + 1).Value = pedido(c1, c6)
Next c6
End If
[U][B]' I would like my code to skip up to here if i encounter an error[/B][/U]
Next c4
Next c3
Next c2
Next c1
DoEvents
Application.Calculation = xlAutomatic
Application.ScreenUpdating = True
End Sub
Everything else is fine cause i tested it under debug.
Could you help me with that label thing?
Thank you very much!