Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Microsoft Office > Excel VBA > Excel VBA
|
Excel VBA Discuss using VBA for Excel programming.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Excel VBA section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old May 4th, 2012, 11:17 AM
Registered User
 
Join Date: May 2012
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default Unlocking Cells Based Upon Value of Another Cell

I have two columns (J and K - rows 4 through 133) on a sheet called "SMATV". In J a user will input a channel number and in column K it will state a channel name via a vlookup on another sheet. All this is done but here's the issue......channels 2-99 don't have a name to lookup. It will be a user inputted name. I wanted to lock down column J since it's a formula but I need the user to be able to input a name if the value in column J is less than 99. Is there a way using vba to unlock the cell and clear the formula so the user can input a name if J is less than 99?
 
Old May 7th, 2012, 11:58 AM
Friend of Wrox
 
Join Date: Sep 2005
Posts: 812
Thanks: 1
Thanked 53 Times in 49 Posts
Default

Hi

Here is a hint

Code:
Dim oRng As Range
Set oRng = ActiveSheet.Range("J3")
If oRng.Value < 99 Then
    oRng.ClearContents
    oRng.Locked = True
End If
Cheers
Shasur
__________________
C# Code Snippets (http://www.dotnetdud.blogspot.com)

VBA Tips &amp; Tricks (http://www.vbadud.blogspot.com)





Similar Threads
Thread Thread Starter Forum Replies Last Post
Replace cells, dependant on other cell values Ross66 VB How-To 0 July 16th, 2011 08:05 AM
Format cell based on another cell billy1r Excel VBA 1 June 15th, 2011 09:06 PM
Remove empty cells and paste data from cell below aquavion Excel VBA 4 September 28th, 2009 09:52 AM
cells values with validation in another cell srahuf Excel VBA 1 May 30th, 2008 04:05 AM
How to create a Hyperlink based on Cell Contents chatguy Excel VBA 4 October 15th, 2007 09:43 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.