LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.misc
SK8 SK8 is offline
external usenet poster
 
Posts: 2
Default Lock Cells Dependent on Prior Months

Please help, I'm working on a project to design a new forecast template and I
need to be able to lock a range of cells dependent on a given month. For
instance

A1 = Target Month

Range K9 : V9 has the 12 months of the year where K9 = Jan 2010, L9 = Feb
2010 ... V9 = Dec 2010

As the months in the year move along, I'd like to lock all prior months for
the corresponding cell months for rows 18-251. So if the Target Month (A1)
is April 2010, then I'd like to lock cells K9:M251. In essence I'd like to
restrict users from unintentionally changing actual data and only input their
new forecast for the upcoming months.

I took a couple of stabs at it and tried the following code, but was still
missing something. Any help would be greatly appreciated.

Private Sub Worksheet_Change(ByVal Target As Range)

If K9 <= A1 Then
Range("K11:K251").Locked = True
End If
End Sub
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Lock worksheet, based on dropdown selection prior worksheet Michele New Users to Excel 9 June 21st 09 10:31 PM
3 months prior and 3 months post a date renee Excel Worksheet Functions 2 May 2nd 08 05:46 PM
How do I create 3 list boxes dependent on prior selections GILBERT Excel Discussion (Misc queries) 3 April 25th 07 11:56 PM
formula to sum the prior 12 cells regardless of added columns? Mopechicken Excel Worksheet Functions 6 October 12th 06 04:20 PM
sum values between today and 6 months prior Qaspec Excel Worksheet Functions 3 January 19th 05 08:17 PM


All times are GMT +1. The time now is 04:04 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"