+ Reply to Thread
Results 1 to 2 of 2

VBA Code & Formula Interference

Hybrid View

  1. #1
    Forum Expert Keebellah's Avatar
    Join Date
    01-12-2014
    Location
    The Netherlands
    MS-Off Ver
    Office 2021 (Windows)
    Posts
    7,937

    Re: VBA Code & Formula Interference

    I don't really understand what you want but try this

    Private Sub Worksheet_Change(ByVal Target As Range)
        If Intersect(Target, Range("P:P")) Is Nothing Then Exit Sub
        If Target.Cells.Count > 1 Then Exit Sub
    
        'Turn off events to keep out of loops
        Application.EnableEvents = False
    
        If Target.Value < Target.Offset(0, 1).Value * 2 Then
            Target.Offset(0, 1).ClearContents
            Target.Offset(0, 1).Select
            MsgBox "Re-enter a valid value in " & Target.Offset(0, 1).Address(False, False)
        Else
            Target.Offset(0, 1).ClearContents
            Target.Offset(0, 1).Select
        End If
    
        Application.EnableEvents = True
    End Sub
    Attached Files Attached Files
    ---
    Hans
    "IT" Always crosses your path!
    May the (vba) code be with you... if it isn't; start debugging!
    If you like my answer, Click the * below to say thank-you

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. [SOLVED] return the word interference if the cell contains < symbol
    By score in forum Excel General
    Replies: 4
    Last Post: 12-16-2012, 12:58 PM
  2. How to protect against user interference...
    By Legend Rubber in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 11-21-2012, 09:28 AM
  3. Interference between Macros?
    By RDS in forum Excel General
    Replies: 1
    Last Post: 02-20-2012, 06:00 AM
  4. Interference between 2 ComboBox
    By Magic_Doctor in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 10-20-2011, 03:38 PM
  5. Sharepoint Interference with Macros
    By jomili in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 09-02-2011, 12:19 PM
  6. Sheet Protection Interference
    By jomili in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 01-19-2011, 11:53 AM
  7. [SOLVED] dragging without interference
    By BorisS in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 05-20-2005, 04:06 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