View Single Post
  #2  
Old May 14th, 2010, 09:54 PM posted to microsoft.public.excel.misc
JLatham
external usenet poster
 
Posts: 1,896
Default Dynamic List Data Validation

Are you using the code I provided, or Roger Govier's fromthe "reset column C"
help request? Not that it matters a whole lot, just so we know what we're
working with here.

As I understand your request now, the starting point for stuff would be an
entry in column H, and a change in H would then drive the contents of B,
which in turn drives the contents of C: when a change is made in B, the entry
in C is now cleared.

Also, as I recall, we're actually not concerned with specific cell "H11",
but with H, B and C on any given row? Correct?

Assuming you're using my code, which I'll modify a bit here for this use,
you could modify that this way, I believe this is what you want:

Private Sub Worksheet_Change(ByVal Target As Range)
'this will clear the contents of the cell
'in column C on the same row when a
'change in the entry in column A of that row
'is made
'assumes row 1 has labels you don't
'want to erase
'
'also, if an entry is made in column H
'then entry in B of same row is affected:
' if H# entry 0 then B = "Deposit"
' otherwise (H# = 0 or empty) then
' B# = "Payment"
'
Application.EnableEvents = False
Select Case Target.Column
Case Is = 1 ' change in column A
'Clear entry in C if entry made in A
If Target.Row 1 Then
Target.Offset(0, 2).ClearContents
End If
Case Is = 8 ' Change in Column H
'make changes in column B on same row
If Target 0 Then
Target.Offset(0, -6) = "Deposit"
Else
Target.Offset(0, -6) = "Payment"
End If
Case Else
'do nothing
End Select
Application.EnableEvents = True
End Sub


"Bean Counter" wrote:

Hi All,

I have created a dependent list where your choice in column B will limit the
choices you have in Column C. I have also added a macro that will erase the
value selected in C if the value of B changes. Now what I would like to do
is have the value in Column B auto populate depending on whether or not there
is a value populated in Column "H". ( the two choices for Column B are
Deposit or Payment, and Column H is the Deposit Column. By default, if there
is no value in the deposit column, there will be a value in the payment
column). I can get the formula in column B to work
(=IF(H110,"Deposits","Payments")), but doing so renders my data validation
(the dependent list in column C), and also my macro useless. Any idea how I
can overcome this problem?? Any help is greatly appreciated!!!!
--
Thanks for all of the help. It is much appreciated!!!!