Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 08-16-2011, 11:10 PM
Catalin.B Catalin.B is offline Convert Formula Result to Static Text Windows Vista Convert Formula Result to Static Text Office 2007
Expert
 
Join Date: May 2011
Location: Iaşi, Romānia
Posts: 386
Catalin.B is on a distinguished road
Default

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
Reply With Quote
Reply



Similar Threads
Thread Thread Starter Forum Replies Last Post
Merge Fields and Static Text kbranden Mail Merge 1 06-15-2011 09:02 AM
Convert Formula Result to Static Text 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
Convert Formula Result to Static Text Checkbox on Userform result in Text in Word Dolfie_twee Word VBA 1 06-22-2010 07:54 AM

Other Forums: Access Forums

All times are GMT -7. The time now is 08:18 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft