Új hozzászólás Aktív témák

  • lenkei83

    tag

    Sziasztok!

    Rá tudna nézni valaki, hogy miért akad ki a szinescella.Locked = False sornál?

    Köszi
    P.

    Sub zarolas_()
    Dim ws As Worksheet
    Dim cella As Range
    Dim psw As Variant
    Dim szinescella As Range

    Application.FindFormat.Clear
    Application.ScreenUpdating = False
    Application.Calculation = xlCalculationManual
    Application.EnableEvents = False

    Application.FindFormat.Interior.Color = RGB(255, 255, 0)
    Application.ReplaceFormat.Interior.Color = RGB(255, 255, 0)

    psw = ""

    For Each ws In ThisWorkbook.Worksheets
    ws.UsedRange.Cells.Locked = True

    For Each cella In ws.UsedRange.Cells
    Set szinescella = cella.Find(what:="", searchformat:=True)
    szinescella.Locked = False
    Next cella

    Next ws

    ws.Protect Password:=psw, userinterfaceonly:=True
    MsgBox "Munkalapok zárolva"
    Application.Calculation = xlCalculationAutomatic
    Application.ScreenUpdating = True


    End Sub

Új hozzászólás Aktív témák