+ Reply to Thread
Results 1 to 7 of 7

How to lock header cells in the following code

  1. #1
    Registered User
    Join Date
    07-15-2009
    Location
    Rockford, IL
    MS-Off Ver
    Excel 2003
    Posts
    38

    How to lock header cells in the following code

    Hi,
    I am exporting records from access to an excel sheet. The following is a
    part of my code:
    Please Login or Register  to view this content.
    However the code to lock each of the header cell is not working. I would
    appreciate any help for resolution of the above issue. Also how does one make
    the backcolor yellow for each of the header cell in the above process.
    Thanks.

  2. #2
    Forum Expert
    Join Date
    01-15-2007
    Location
    Brisbane, Australia
    MS-Off Ver
    2007
    Posts
    6,591

    Re: How to lock header cells in the following code

    Hi

    Try

    Please Login or Register  to view this content.
    Note that the protection will not come into force unless the worksheet is protected.

    rylo

  3. #3
    Registered User
    Join Date
    07-15-2009
    Location
    Rockford, IL
    MS-Off Ver
    Excel 2003
    Posts
    38

    Re: How to lock header cells in the following code

    Hi Rylo
    Thanks for your help. I appreciate it. The color came perfect as I was looking for. However the locking is not working. I believe I am not writing code something with protection or unprotection. Here is my prior code.
    Could you please let me know what I am missing here
    Thanks

    CODE:

    Please Login or Register  to view this content.

  4. #4
    Forum Expert romperstomper's Avatar
    Join Date
    08-13-2008
    Location
    England
    MS-Off Ver
    365, varying versions/builds
    Posts
    22,021

    Re: How to lock header cells in the following code

    FYI, cross-posted on MrExcel too.
    Everyone who confuses correlation and causation ends up dead.

  5. #5
    Registered User
    Join Date
    07-15-2009
    Location
    Rockford, IL
    MS-Off Ver
    Excel 2003
    Posts
    38

    Re: How to lock header cells in the following code

    Sorry about that RomperStomper. Do you have any thoughts why this is not working. I need a urgent solution to this. Since I am new to excel vba I do not seem to figure out where I am going wrong. Thanks.

  6. #6
    Forum Expert
    Join Date
    01-15-2007
    Location
    Brisbane, Australia
    MS-Off Ver
    2007
    Posts
    6,591

    Re: How to lock header cells in the following code

    Hi

    Unlock all the cells on the sheet, run the code to lock the header cells, then protect the sheet.

    Do things manually, and if it gives you the result you want, then record the macro and incorporate the steps that will unlock all the cells on the sheet, and perform the protection.

    rylo

  7. #7
    Registered User
    Join Date
    07-15-2009
    Location
    Rockford, IL
    MS-Off Ver
    Excel 2003
    Posts
    38

    Re: How to lock header cells in the following code

    Thnks Rylo. I am going to work on your advise.

+ 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