imam namrec eno majhno tezavo. S pomocjo nekega tutoriala sem prisel do sledece kode:
Koda: Izberi vse
Sub searchdata()
Dim erow As Long
Dim ws As Worksheet
Dim lastrow As Long
Dim count As Integer
lastrow = Sheets("item_price").Cells(Rows.count, 1).End(xlUp).Row
count = 0
For x = 2 To lastrow
If Sheets("item_price").Cells(x, 1) = Sheet2.Range("B3") Then //tukaj bi rad to implementiral//
Sheet2.Range("A11") = Sheets("item_price").Cells(x, 1)
Sheet2.Range("B11") = Sheets("item_price").Cells(x, 2)
Sheet2.Range("C11") = Sheets("item_price").Cells(x, 3)
Sheet2.Range("D11") = Sheets("item_price").Cells(x, 4)
count = count + 1
End If
Next x
If count = 0 Then
Set ws = Worksheets("sheet3")
erow = ws.Cells(Rows.count, 1).End(xlUp).Offset(1, 0).Row
ws.Cells(erow, 1) = Date
ws.Cells(erow, 2) = Sheet2.Range("B3")
Sheet2.Range("A11:D11").ClearContents
End If
Vnaprej se zahvaljujem za pomoc.
Lep pozdrav