![]() |
|
|
|
#1
|
|||
|
|||
|
you can setup cell A1 to decide if the macro should run.
info about events :http://www.cpearson.com/excel/events.htm but will work only when you change the value in cell A1,it will not fire when a formula result changes, so this means it will work the same way ![]() How do I run a macro every time a certain cell changes its value? ![]() There is an event called Worksheet_Change which is triggered when a value is entered (it will not fire when a formula result changes). One of the arguments to this event is 'Target' which is a reference to what changed. Since this event will occur whenever a value changes - you can use the target to see if it is the cell you are interested in:Private Sub Worksheet_Change(ByVal Target As Range) If Intersect(Target, Range("A1")) Is Nothing Then Exit Sub Else 'Do whatever you need to do... End If End Sub |
|
#2
|
|||
|
|||
|
Quote:
I don't know anyone who does this, except maybe, you... ![]() Most of the people i know, between double click and enter, is typing data, or writing formulas... Another idea for you is to run your macro every 30 seconds, or less ... Sub CopyFormulaResults() Application.OnTime Now + TimeValue("00:00:10"), "CopyFormulaResults" Range("H10:H50").Select Selection.Copy Range("I10").Select Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks:=False, Transpose:=False Application.CutCopyMode = False End Sub |
|
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Merge Fields and Static Text | kbranden | Mail Merge | 1 | 06-15-2011 09:02 AM |
Making items (text, pictures, etc.) static on page
|
Jeremiahts | Word | 3 | 04-07-2011 09:54 PM |
| convert html to text at opening | etfjr | Word | 0 | 12-13-2010 11:14 AM |
| Convert Number to Text | devcon | Word | 0 | 07-10-2010 01:16 AM |
Checkbox on Userform result in Text in Word
|
Dolfie_twee | Word VBA | 1 | 06-22-2010 07:54 AM |