Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Junior Member
 
Posts: 22
Send a message via Skype™ to Bakar
Smile Auto run macro

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
  #2   Report Post  
Posted to microsoft.public.excel.programming
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
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Auto Run a Macro AMell Excel Programming 2 July 31st 07 03:58 PM
Sub Macro vrs Function Macro Auto Start Pat Excel Discussion (Misc queries) 7 June 6th 07 09:53 PM
Macro Help Needed - Excel 2007 - Print Macro with Auto Sort Gavin Excel Worksheet Functions 0 May 17th 07 01:20 PM
Auto-run macro after auto-query refresh (Excel2000,sr1) Bill Cufflin Excel Programming 3 June 29th 06 03:30 AM
Macro Auto Run(2) Gary Excel Worksheet Functions 4 May 18th 06 09:07 AM


All times are GMT +1. The time now is 05:52 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"