+ Reply to Thread
Results 1 to 4 of 4

macro to lock cell by column header based on value in another cell by column header

  1. #1
    Registered User
    Join Date
    04-02-2015
    Location
    Austin, Texas
    MS-Off Ver
    2010
    Posts
    6

    macro to lock cell by column header based on value in another cell by column header

    I have a sales report containing active customers from the database and prospective customers added by the salespeople.
    I want to protect the active customers' names. So, I need a macro that:
    If cell in the "Status" column does not contain the word "New Prospect" (there may be other words in this cell), then protect the cell in the "Customer Name" column.
    Naturally, it needs to search all rows. The number of rows will vary per report.

  2. #2
    Forum Contributor
    Join Date
    06-09-2011
    Location
    Germany
    MS-Off Ver
    Excel 2016
    Posts
    193

    Re: macro to lock cell by column header based on value in another cell by column header

    Hi Closet Guru,

    try this one:
    Please Login or Register  to view this content.
    Don't forget to adjust the values in the first section to "your" values.

    Let me know if this is what you need.

    Theo
    Remember To Do the Following....
    1. Upload sample files
    2. Thank those who have helped you by clicking the Star below the post.
    3. Please mark your post [SOLVED] if it has been answered satisfactorily.

  3. #3
    Registered User
    Join Date
    04-02-2015
    Location
    Austin, Texas
    MS-Off Ver
    2010
    Posts
    6

    Re: macro to lock cell by column header based on value in another cell by column header

    Thank you, that worked great. And I appreciate your notes explaining each portion of the macro.

    Was wondering if there is a way to search by the header, rather than entering the column #, as the column # may change.

  4. #4
    Forum Contributor
    Join Date
    06-09-2011
    Location
    Germany
    MS-Off Ver
    Excel 2016
    Posts
    193

    Re: macro to lock cell by column header based on value in another cell by column header

    Hi ClosetGuru,
    sure, just use the macro below (don't forget to adjust the correct Column Header Names):

    Please Login or Register  to view this content.
    Let me know if it works now, and don't forget to mark the thread as "Solved" if it does.

    Have a happy Easter

    Theo

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Replies: 1
    Last Post: 01-30-2014, 01:42 PM
  2. write userform data to cell based on column header
    By EMAP in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 09-13-2012, 08:30 AM
  3. [SOLVED] Trying to return a column header in a cell based on a value
    By brianfromla in forum Excel General
    Replies: 2
    Last Post: 06-26-2012, 10:37 AM
  4. Fill Row Header based on cell in column
    By diggerd in forum Excel General
    Replies: 2
    Last Post: 01-06-2010, 09:59 PM
  5. Lookup Column Header based on cell value
    By kingcal in forum Excel General
    Replies: 4
    Last Post: 08-13-2009, 03:56 AM

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