View Single Post
  #6   Report Post  
Posted to microsoft.public.excel.worksheet.functions
cferoiu cferoiu is offline
external usenet poster
 
Posts: 9
Default lock cell whit first value

I find my problem; normaly with VBA code:

Private Sub Worksheet_Change(ByVal target As Range)
' Test that the modified cell is in the column A.
If target.Column = 1 Then
' Get the row of the modified cell.
rowOfActiveCell = target.Row

' Update the cells on the column B from the same row, only if
there's no formula yet filled.
If (Cells(rowOfActiveCell, 2).Value = "") Then
Cells(rowOfActiveCell, 2).Value = Cells(rowOfActiveCell - 1,
3).Value
End If

' if A[n] deleted then B[n] deleted
If (Cells(rowOfActiveCell, 1).Value = "") Then
Cells(rowOfActiveCell, 2).Value = ""
End If

' if A[n]<"" then D[n]=n
Cells(rowOfActiveCell, 4).Value = rowOfActiveCell
End If
End Sub

"Ronald R. Dodge, Jr." wrote:

If you talking about arrays, that can be done as well.

If using the worksheet method, you can use a column as an array of values
and if need be setup a 2 column table with the first column being the key
value and the second column being the actual value for that particular key.

Your second away would be setup the same way. Once you have your 2
different 2 column tables setup, you can then use the VLOOKUP function to
get the values

Now for assigning values to an array, it may require the use of VBA coding
depending on the set of circumstances, which case, if you know VBA coding
well enough, then you can use class regular objects and class collection
objects to assign (Set/Let) and get (Get) values. However, if you are new
to VBA coding, you can get by with just defining an array variable and start
learning how to use variables within VBA.

Another option is to look into how to use User Defined Functions (UDF) which
also is setup within VBA. There are limitations to using UDF, but they in
itself can also be very powerful.

--
Thanks,

Ronald R. Dodge, Jr.
Production Statistician
Master MOUS 2000
"cferoiu" wrote in message