I am new in vba. Please help me to solve the issue . I have sheet "Stock" and from row 2 to row 6 we have data entry fields . All things updating in stock sheet except Row5 C5 and the code is in Module3 .
I am new in vba. Please help me to solve the issue . I have sheet "Stock" and from row 2 to row 6 we have data entry fields . All things updating in stock sheet except Row5 C5 and the code is in Module3 .
Can you describe in words what the code in module 3 is supposed to do?
Sub FillStockList()
Dim lrow As Long, r As Range, rr As Range
With Sheets("Stock")
lrow = .Cells(Rows.Count, 1).End(xlUp).Row + 1
For Each r In Range("C4", "C5") 'Worksheet "Invoice" is Active sheet
If Len(r) Then
Set rr = .Rows(9).Find(Trim(Replace(r(0, 2).Value, "Pack", "")), LookAt:=xlWhole)
If Not rr Is Nothing Then
.Value
Else
MsgBox "not found " & r(0, 2).Value, 64: Exit Sub
End If
End If
Next r
.Cells(lrow, 1).Resize(, 2).Value = Array([C2], [C3])
End With
MsgBox "Done", 64
End Sub
the above code search size which is d2 if its find in line 9 then it paste the other fields on its relative Columns
Now its not updating c5 fields
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks