Thread: Auto run macro
View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Don Guillett[_2_] Don Guillett[_2_] is offline
external usenet poster
 
Posts: 1,522
Default Auto run macro

On Monday, October 29, 2012 5:21:47 AM UTC-5, Bakar wrote:
Hi Masters

I Have a macros telling if cell B2 is not blank

clear contents in cell B3

Sub remvpw()

If Range("b2") = "1234" Then

Range("b3").Select

Selection.ClearContents

End If

End Sub

But i can run the macro only by view macros

I want to auto run whenever i insert anything in the cell B2





Plz help

Thnxs



Bakar









--

Bakar


put this macro into the worksheet module

Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Address = Range("b2").Address Then Range("b3").Clear
End Sub