Sub abc()
Dim stfc, ptfc, pmfc As Double
Dim i, j As Integer
Dim mvAs String
Dim lngMonthNo, lngMonthNo2, rngsearch, rngsearch2 As Range
Dim st2, st3 As Worksheet
Set st2 = Sheets("x")
Set st3 = Sheets("y")
mv= st3.Range("b8").Value
For j = 0 To 3 ' nr de categorii
For i = 0 To 9 'nr de furnizori
Set rngsearch = Range("f8:f19")
lngMonthNo = rngsearch.Find(what:=mv, LookIn:=xlValues, lookat:=xlWhole).Row
st2.Select
Set rngsearch2 = st2.Range(st2.Cells(4, 6), st2.Cells(4, 83))
lngMonthNo2 = rngsearch2.Find(what:=mv, LookIn:=xlValues, lookat:=xlWhole).Column
"Object variable or With block variable not set (Error 91)" is the error i get on the last line of code.
Bookmarks