Results 1 to 5 of 5

Macro does not work with protected sheet

Threaded View

  1. #1
    Registered User
    Join Date
    11-11-2020
    Location
    Australia
    MS-Off Ver
    2016
    Posts
    49

    Macro does not work with protected sheet

    Hi there,

    I have a macro that transfer disposed items to another sheet.
    However, it appears that when I lock the cells on both sheets (D4:D500) and (F4:F500), the macro button (Archive Disposed) won't run and has an error of 400.

    Currently I have this macro in my workbook:

    Option Explicit
    Sub TestKen()

    Dim ws As Worksheet

    Application.ScreenUpdating = False

    For Each ws In Worksheets
    If ws.Name <> "Sheet2" Then
    With ws.[A4].CurrentRegion
    .AutoFilter 6, "Disposed"
    .Offset(1).EntireRow.Copy Sheet2.Range("A" & Rows.Count).End(3)(2)
    .Offset(1).EntireRow.Delete
    .AutoFilter
    End With
    End If
    Next ws


    Application.ScreenUpdating = True

    End Sub


    Any idea how to solve this issue?
    Password I set for the worksheets are 123
    I assume I need a macro that unprotects the sheets, run the macro, and then re-protect the sheets again?

    Thanks in advance
    Cheers Ken
    Attached Files Attached Files

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. MAcro does not work when certain cells in a work sheet are protected
    By Unnati in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 12-10-2012, 03:38 AM
  2. Macro does not work when sheet is protected?? Please Help
    By savethisid in forum Excel General
    Replies: 1
    Last Post: 04-06-2012, 07:24 AM
  3. Macro does not work when sheet is protected??
    By savethisid in forum Excel General
    Replies: 1
    Last Post: 04-06-2012, 07:01 AM
  4. protected sheet, allow for macro to work
    By jw01 in forum Excel General
    Replies: 2
    Last Post: 08-22-2011, 02:55 PM
  5. Getting a Macro to work on protected sheet
    By Benw in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 08-26-2010, 06:33 AM
  6. Macro will not work when sheet is Protected
    By alachape in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 07-02-2008, 03:13 PM
  7. Replies: 2
    Last Post: 07-11-2006, 11:15 PM
  8. Macro protected work sheet
    By Henry in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 03-14-2006, 07:40 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1