+ Reply to Thread
Results 1 to 3 of 3

Formatting/locking/Unlocking range of cells

  1. #1
    Registered User
    Join Date
    11-08-2007
    Posts
    8

    Formatting/locking/Unlocking range of cells

    I need to create a grid that displays and accepts data based on a rolling 14-days, seven days prior to Report Date and seven days following Report Date.

    The data is displayed in columns by date. For any column where the date is not in the same calendar month as the Report Date, I want to "grey" out and lock the cells, preventing data entry.

    How would I code a VB loop to accomplish this?

    I have attached a small worksheet showing what I am tryiny to accomplish.

    Thanks,
    SSGMiami
    Attached Files Attached Files

  2. #2
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,258
    Hello SSGMiami,

    The attached workbook contains 2 macros to automatically gray out and lock the cells that aren't in the current month of the date in cell "C3". The macro locks the worksheet but is not password protected. Password protected can be added if you want it.

    Main Macro
    Please Login or Register  to view this content.
    Worksheet Event Macro
    Please Login or Register  to view this content.
    Sincerely,
    Leith Ross
    Attached Files Attached Files

  3. #3
    Registered User
    Join Date
    11-08-2007
    Posts
    8

    Thanks!

    I will take a shot at integrating the code into my spreadsheet later today. I need to make a few modifications because I have 6 grids similar to this in the spreadsheet. The columns are the same among the grids, but the StartRow and LastRow will change depending on the grid being examined. Also, this code along with other routines are executed by pressing a "Calculate" button I have on the page.

    I will let you know the results.

    SSGMiami

+ 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