If you want the FillPrices to automatically do all the sheets, try this:
Sub FillPrices()
Dim Period As Long, Guess As Long, ws As Worksheet, PeriodRNG As Range
Guess = Sheets("ALB").Range("C" & Rows.Count).End(xlUp).Offset(1, -2).Value
Period = Application.InputBox("What period to process?", "Period", Guess, Type:=1)
If Period = 0 Then Exit Sub
On Error Resume Next
For Each ws In Worksheets
If ws.Name <> "Buletin" And ws.Name <> "PAZAR" Then
With ws
Set PeriodRNG = .Range("A:A").Find(Period, LookIn:=xlValues, LookAt:=xlWhole)
If Not PeriodRNG Is Nothing Then
With PeriodRNG.Offset(, 2)
.FormulaR1C1 = _
"=IF(VLOOKUP(R1C3,Buletin!C[-2]:C[9],8,0)=0,R[-1]C,VLOOKUP(R1C3,Buletin!C[-2]:C[10],13,0))"
.Value = .Value
If .Value = .Offset(-1).Value Then .Font.ColorIndex = 3
End With
Set PeriodRNG = Nothing
End If
End With
End If
Next ws
End Sub
Bookmarks