Hi! The linked thread shows almost exactly what I'm looking to accomplish.<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com
ffice
ffice" /><o
></o
>
http://www.mrexcel.com/forum/showthread.php?p=1572477 <o
></o
>
<o
></o
>
But as I know very little about VBA, I have a few questions...<o
></o
>
<o
></o
>
I have two different sites entering information onto a spreadsheet. If the first site enters information in Column B, I need column C locked so the second site doesn't write try entering useless information. If the first site does not enter information, column C stays unlocked.<o
></o
>
<o
></o
>
Column B does not actually contain numerical values. It contains references to numerical values from another workbook.
<o
></o
>
<o
></o
>
So the following is what VBA Noob suggested in the other thread:
<o
></o
>
<o
></o
>
></o
>
<o
></o
><o
></o
>
So… how could I make the following changes and, is the fact that there is a reference to another workbook rather than an actual numerical value going to make a difference?
And lastly, how to I apply this to all the rows, not just C1 & B1, but to C2 & B2 all the way down?
<o
></o
>
<o
></o
>




http://www.mrexcel.com/forum/showthread.php?p=1572477 <o


<o


But as I know very little about VBA, I have a few questions...<o


<o


I have two different sites entering information onto a spreadsheet. If the first site enters information in Column B, I need column C locked so the second site doesn't write try entering useless information. If the first site does not enter information, column C stays unlocked.<o


<o


Column B does not actually contain numerical values. It contains references to numerical values from another workbook.
<o


<o


So the following is what VBA Noob suggested in the other thread:
<o


<o


<oTry an event macro > right click sheet tab > select view code > paste in the below.
If A1 formula returns 10 then the cell is locked.
<o></o
>
<o></o
>
<oCode:Private Sub Worksheet_Calculate() Dim Rng As Range<o:p></o:p> Set Rng = Range("A1")<o:p></o:p> <o:p></o:p> Select Case Rng<o:p></o:p> Case Is = 10<o:p></o:p> Rng.Locked = True<o:p></o:p> Case Else<o:p></o:p> Rng.Locked = False<o:p></o:p> End Select<o:p></o:p> End Sub
></o
>
HTH<o></o
>
<o></o
>
VBA Noob


<o




So… how could I make the following changes and, is the fact that there is a reference to another workbook rather than an actual numerical value going to make a difference?
And lastly, how to I apply this to all the rows, not just C1 & B1, but to C2 & B2 all the way down?
<o


Code:
[SIZE=3][FONT=Times New Roman]Private Sub Worksheet_Calculate()[/FONT][/SIZE]
[SIZE=3][FONT=Times New Roman]Dim Rng As Range<o:p></o:p>[/FONT][/SIZE]
[SIZE=3][FONT=Times New Roman]Set Rng = Range("C1")<o:p></o:p>[/FONT][/SIZE]
[SIZE=3][FONT=Times New Roman]<o:p></o:p>[/FONT][/SIZE]
[SIZE=3][FONT=Times New Roman]Select Case Rng<o:p></o:p>[/FONT][/SIZE]
[SIZE=3][FONT=Times New Roman] Case Is = [COLOR=blue]B1 is Greater than 0 or Is not blank (whichever would work better)<o:p></o:p>[/COLOR][/FONT][/SIZE]
[SIZE=3][FONT=Times New Roman] Rng.Locked = True<o:p></o:p>[/FONT][/SIZE]
[SIZE=3][FONT=Times New Roman] Case Else<o:p></o:p>[/FONT][/SIZE]
[SIZE=3][FONT=Times New Roman] Rng.Locked = False<o:p></o:p>[/FONT][/SIZE]
[SIZE=3][FONT=Times New Roman]End Select<o:p></o:p>[/FONT][/SIZE]
[SIZE=3][FONT=Times New Roman]End Sub[/FONT][/SIZE]

