Results 1 to 10 of 10

VBA won't execute when formula changes cell value

Threaded View

  1. #1
    Registered User
    Join Date
    11-26-2013
    Location
    Here
    MS-Off Ver
    Excel 2003
    Posts
    11

    VBA won't execute when formula changes cell value

    Hi all,

    I'm having a hard time getting this to work;

    VBA executes the code when value of a cell is "X"

    When the value of a cell is changed to "x" due to a formula (=IF(A3+A5=4,"x",0)), unfortunately VBA will not be triggered unless I manually put an 'X' into the cell.

    Can any one help me out with this?


    the code is use:

    Private Sub Worksheet_Change(ByVal Target As Range)
     Dim r As Range
    
     Application.EnableEvents = False
     If LCase(Target) = "x" Then
     With Sheets("mail")
     LR = .Cells(Rows.Count, 1).End(xlUp).Row + 1
     Target.EntireRow.Copy Destination:=.Cells(LR, 1)
     Target.EntireRow.Delete
     End With
     End If
     Application.EnableEvents = True
     End Sub
    
     Private Sub Worksheet_SelectionChange(ByVal Target As Range)
     Me.Calculate
     End Sub
    Last edited by Intern2; 12-30-2013 at 11:52 AM.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. IF cell=error execute sub 1 if value execute sub 2... possible?
    By CDNcameron in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 07-31-2013, 05:28 PM
  2. Modify formula to not execute if cell contains certain text
    By icets in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 06-26-2011, 08:59 PM
  3. Execute a formula Indirectly
    By TomTheTrader in forum Excel General
    Replies: 2
    Last Post: 01-22-2008, 08:01 AM
  4. execute once formula
    By tekman in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 12-07-2005, 01:52 PM
  5. Replies: 4
    Last Post: 01-20-2005, 05:40 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1