Search : in
By :

Cannot get a Macro to run automatically

Last answer on Oct 7, 2009 1:52:10 am BST Leigh G, on Oct 6, 2009 12:55:10 pm BST 
 Report this message to moderators

Hello,

I am really struggling to get a macro to run automatically. I have created a sheet that logs entry/exit from my offices. I have created a macro that searches all the entered text and when it finds two entries the same it deletes both. (If the name appears the staff member is in, if it doesn't then they are not here!)

I now need this to run everytime a cell is filled in. I have tried using the Worksheet change event however this seems to result in nothing happening. I am completely at a loss as to what to do as I have been working with VB for a short while but have been self educated (largely thanks to forums like this!) so have large gaps in my understanding of how it all works. The code I have so far is:

Private Sub Worksheet_Change(ByVal Target As Range)

If Target.Address = "A:A" Then

Call Remove_Duplicates

End Sub

Remove_Duplicates is the name of my Macro.
This is entered onto the worksheet page in VB but does nothing! I have tried using a specific cell as the target but still to no avail. Can anyone please help as I am several hours into this and very confused!

Many Thanks,

Leigh

Configuration: Windows XP Internet Explorer 7.0

Best answers for « Cannot get a Macro to run automatically » in :
How to get rid of SPY AXE? ShowHow to get rid of SPY AXE? Methods of elimination Deactivate System Restore Download Smitfraudix and Hoster Download and unzip smitfraudix Download and unzip Hoster Run SmitfraudFix.exe Spy Axe is a rogue application that pretends...
Automatic software startup ShowAutomatic software startup For Konqueror Second alternative It is possible to specify what software to run KDE startup. Below is a tips showing you how to specify which software to run at KDE start up:- For Konqueror Go to the...
[Windows XP] Disable automatic restart Show[Windows XP] Disable automatic restart By default, Windows XP is set to restart when an error occurrs. To stop the uncontrolled reboots, proceed as follows: Go to Start Menu/Control Panel/System/System Properties Select the Advanced...
Download Super Macro ShowSuper macro is a free software which allows to create macro under Windows in order to activate diverse automatic actions. Apart being free, this software is easy to use and requires no knowledge in programming. You just simply click buttons, then...
Introduction to Office Automation ShowWhat is office automation? The term office automation refers to all tools and methods that are applied to office activities which make it possible to process written, visual, and sound data in a computer-aided manner. Office automation is intended...

1

 venkat1926, on Oct 7, 2009 1:52:10 am BST

Instead of this line
If Target.Address = "A:A" Then
use
if target.column=1 then

now see whether it works.

even though if you park the macro "remove_dupliates" in "worksheet page" it works it is better to park it in the standard module.

Reply to venkat1926