LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,058
Default Lock Cell if another cell contains data

Say we have worksheets sa and sb. In worksheet code for sa enter:

Private Sub Worksheet_Change(ByVal Target As Range)
Call routine
End Sub


In a standard module:

Sub routine()
Dim w As Worksheet
Set w = Worksheets("sb")
For Each r In w.UsedRange
r.Locked = r.HasFormula
Next
End Sub
--
Gary's Student


"adodson" wrote:

I would like to lock formulas in cells on worksheet B if data is entered in
worksheet A. Otherwise, the user would need to enter data on top of the
formula.

How would I go about this?

I tried looking through other posts and couldn't find this... so thanks for
any assistance you may offer.

 
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 data in a cell a specific cell based on selection on other ce CrimsonPlague29 Excel Worksheet Functions 0 May 10th 06 11:06 AM
Lock Data in Cell after entered CrimsonPlague29 Excel Discussion (Misc queries) 0 May 9th 06 11:51 AM
Lock Cell After Data Entry Ripper Excel Discussion (Misc queries) 1 February 28th 06 08:17 PM
Lock a cell when a given cell contains data derdman Excel Programming 1 February 9th 04 10:29 PM
lock one cell when data in another dh Excel Programming 1 July 11th 03 11:55 PM


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

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

About Us

"It's about Microsoft Excel"