- 30 Mar 2021 às 22:23
#63411
Ola amigos estou com esse erro e não sei como resolver..
Alguem pode me dar uma ajuda
tem uma imagem do erro em anexo e abaixo o código..
Desde já agradeço..
Sub Proc()
Dim codigo_prod As String
Dim ULTLINHA As Integer
Dim Inicio As Integer
Dim result_proc As String
Dim Sefaz As Worksheet
Set Sefaz = Sheets("Sefaz")
ULTLINHA = Sheets("SEFAZ").Cells(Cells.Rows.Count, 1).End(xlUp).Row
For Inicio = 2 To ULTLINHA
With Sefaz
codigo_prod = Sheets("SEFAZ").Cells(Inicio, 21).Value
.Cells(Inicio, 22).Value = Application.WorksheetFunction.VLookup(codigo_prod, Sheets("C100").Range("K:L"), 2, False)
'Sheets("SEFAZ").Cells(Inicio, 22).Value = result_proc
End With
Next Inicio
End Sub
Alguem pode me dar uma ajuda
tem uma imagem do erro em anexo e abaixo o código..
Desde já agradeço..
Sub Proc()
Dim codigo_prod As String
Dim ULTLINHA As Integer
Dim Inicio As Integer
Dim result_proc As String
Dim Sefaz As Worksheet
Set Sefaz = Sheets("Sefaz")
ULTLINHA = Sheets("SEFAZ").Cells(Cells.Rows.Count, 1).End(xlUp).Row
For Inicio = 2 To ULTLINHA
With Sefaz
codigo_prod = Sheets("SEFAZ").Cells(Inicio, 21).Value
.Cells(Inicio, 22).Value = Application.WorksheetFunction.VLookup(codigo_prod, Sheets("C100").Range("K:L"), 2, False)
'Sheets("SEFAZ").Cells(Inicio, 22).Value = result_proc
End With
Next Inicio
End Sub