View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Toppers Toppers is offline
external usenet poster
 
Posts: 4,339
Default change by value in drop down list

Hi,
It worked OK for me i.e. change of value of D2 was always reflected in
the message in "changesquare":

Private Sub Worksheet_Change(ByVal Target As Range)

If Target.Address = Range("d2").Address Then
Range("d5").Value = Range("b1").Value
Range("f5").Value = Range("c1").Value
Run "changesquare", Range("d2").Value
End If
End Sub

Sub Changesquare(n)
MsgBox "Changesquare called " & n
End Sub

What does "changesquare" do? Does it work if you don't run it?

Sorry I can't be more helpful.

MS 2003


"choice" wrote:

i have a data validation with a drop down list, and

Private Sub Worksheet_Change(ByVal Target As Range)

If Target.Address = Range("d2").Address Then
Range("d5").Value = Range("b1").Value
Range("f5").Value = Range("c1").Value
Application.Run "changesquare"
End If
End Sub

however when i drop down the list and select a different value nothing happens
any ideas?

thanks in advance