+ Reply to Thread
Results 1 to 4 of 4

Run-time error 1004 when protecting sheet

  1. #1
    Registered User
    Join Date
    05-10-2013
    Location
    chicago
    MS-Off Ver
    Excel 2010
    Posts
    52

    Run-time error 1004 when protecting sheet

    I have the following code in place to the current time entered in column G when column D is populated:

    Please Login or Register  to view this content.
    It works all well and good until I protect any of the cells on the sheet, even ones not included in the macro. I reads, "Run-time error 1004: Unable to set the NumberFormat propert of the Range class. When I click debug, it points to
    Please Login or Register  to view this content.
    . Anyone know how to correct this?

  2. #2
    Registered User
    Join Date
    05-10-2013
    Location
    chicago
    MS-Off Ver
    Excel 2010
    Posts
    52

    Re: Run-time error 1004 when protecting sheet

    Any suggestions?

  3. #3
    Forum Guru
    Join Date
    07-25-2011
    Location
    Florida
    MS-Off Ver
    Excel 2003
    Posts
    9,613

    Re: Run-time error 1004 when protecting sheet

    You could manually preset the number formatting of G2:G32 before you protect the sheet. Then just remove the .NumberFormat line in the code. The number formatting shouldn't change.

    Alternatively, allow cell formatting when you protect the sheet.

  4. #4
    Registered User
    Join Date
    05-10-2013
    Location
    chicago
    MS-Off Ver
    Excel 2010
    Posts
    52

    Re: Run-time error 1004 when protecting sheet

    That worked, thanks!

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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