LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #3   Report Post  
Curtis
 
Posts: n/a
Default

I can't get the formula you sent me to work. What I want to do is lock cells
H9 to GV9 once the value of cell G9 becomes 0 so that a user of this
worksheet cannot oversell a product. A number an be entered into the cells
H9 to GV9 to tell the spreadsheet user how many of each product a client
needs. The cell G9 refers to the number of product left in inventory. As
the user enters #'s into any of these cells, the number of inventory
remaining decreases until it get to zero, but right now you can sell infinite
product because the value of G9 can go into negative numbers. When I use the
formula that you gave me, it always comes back with errors. The name of the
worksheet according to the view code is Sheet 1(Inventory). What am I doing
wrong. Can I also make it so that I cannot enter a value in any of the cells
that would make G9 lower than 0 and show a message when a user tries to do
this, prompting them to change the # or continue anyways.

"Ian" wrote:

Right click on the sheet tab and select View Code, then paste the routine
below into the VBA window (where the falshing cursor is).

Change the sheet names and cell references to suit your requirements.

Private Sub Worksheet_Change(ByVal Target As Range)
Worksheets("Sheet1").Unprotect
If Range("A1") = 0 Then
Range("B1").Locked = True
Range("C2:C3").Locked = True
Else
Range("B1").Locked = False
Range("C2:C3").Locked = False
End If
Worksheets("Sheet1").Protect
End Sub


--
Ian
--
"Curtis" wrote in message
...
I am not an expert at excel, but I want to lock certain cells, once the
value
of a different cell that makes reference in a formula to these cells
reaches
0. Can this be done and can someone tell me how.




 
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
Disk is Full Microsoft Excel [email protected] Excel Discussion (Misc queries) 1 August 31st 05 02:35 AM
Excel - Autom. Filter "Empty / Non Empty cells" should come first Rom Excel Discussion (Misc queries) 0 August 10th 05 04:32 PM
Cells User Select Locked after upgrade to Excel 2002 TWilson Excel Discussion (Misc queries) 1 August 5th 05 12:22 PM
changing the way Excel displays selected cells P Boric Excel Discussion (Misc queries) 1 July 28th 05 01:09 PM
Excel should allow more options for formatting cells rj123 Excel Worksheet Functions 0 July 23rd 05 03:45 AM


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

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"