Help with getting marco to run


Posted by Paul on October 30, 2001 1:04 PM

I have the code below in the worksheet “view sheet code section” it will fire the marco “getpic” if I type anything in A3. But what I have is a formula in A3 that puts a number or “” in the cell, the marco will not fire even if the formula returns a number, is there anyway to make a marco run by a number being returned by a formula in a cell? What I am trying to do is to have a drop down box, via data valadation list, and using vlookup to return the path to a picture, all this works except I have to click a command button to show the picture I want it to be displayed automatically when the name is picked from the list. Thanks for your help.

Private Sub Worksheet_Change(ByVal Target As Excel.Range)
If Target.Address = "$A$3" And Target.Value <> "" Then
Application.Run "'Insert pic.xls'!GetPic"
End If
End Sub

Posted by Geoffrey Astle on October 30, 2001 2:18 PM


Private Sub Worksheet_Calculate()
If [A3].Value <> "" Then
Application.Run "'Insert pic.xls'!GetPic"
End If
End Sub




Posted by Paul on October 30, 2001 3:22 PM

Thanks that works GREAT!