Thread: macro call
View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.misc
Franz Verga Franz Verga is offline
external usenet poster
 
Posts: 459
Default macro call

Steve wrote:
I need to call a macro if a cell equals a contractors name.
Something like:
if c1:d1 = "Integrity Remodeling" then
call macro22
end if
end sub
But I cant get it work. Any suggestions



Hi Steve,

maybe something like this:

Private Sub Worksheet_Change(ByVal Target As Range)
If Not Intersect(Target, "A1") Is Nothing Then
If Target.Value = "Integrity Remodeling" Then Call MyMacro
End If
End Sub

To use this code right click the tab of the sheet in which you need to use,
select View code and copy and past the above code. You need to change A1
with your target cell.

--
Hope I helped you.

Thanks in advance for your feedback.

Ciao

Franz Verga from Italy