Mohol by ste použiť namiesto toho Evaluate. Je to vlastne 1 riadok kódu. Rovnako môžete použiť cyklus.
EDIT:
Alebo takto aj s názvom listu, ak by sa jednalo o iný ako aktívny list...
Sub NasobDel(Oblast As Range, bTyp As Boolean, nHodnota#)
Dim ADR As String
Application.ScreenUpdating = False
With Oblast
ADR = "'" & .Parent.Name & "'!" & .Address
.Value2 = Evaluate("=IFERROR(SUBSTITUTE(" & ADR & ","","",""."")" & IIf(bTyp, "*", "/") & nHodnota & "," & ADR & ")")
End With
Application.ScreenUpdating = True
End Sub
EDIT:
Alebo takto aj s názvom listu, ak by sa jednalo o iný ako aktívny list...
Sub NasobDel(Oblast As Range, bTyp As Boolean, nHodnota#)
Dim ADR As String
Application.ScreenUpdating = False
With Oblast
ADR = "'" & .Parent.Name & "'!" & .Address
.Value2 = Evaluate("=IFERROR(SUBSTITUTE(" & ADR & ","","",""."")" & IIf(bTyp, "*", "/") & nHodnota & "," & ADR & ")")
End With
Application.ScreenUpdating = True
End Sub
Příloha: 39943_nasob-del-evaluate.zip (23kB, staženo 24x)
citovat