+ Reply to Thread
Results 1 to 5 of 5

Popup message showing adjacent cell value when user enters value in cell

Hybrid View

  1. #1
    Registered User
    Join Date
    10-09-2013
    Location
    UK
    MS-Off Ver
    Excel 2003
    Posts
    13

    Popup message showing adjacent cell value when user enters value in cell

    I am trying to generate a message to the user as follows:

    Each time a value is entered in any cell in range W8:W140 (e.g W10), and the row (row 10) has a value in column G (cell G10)
    then a msgbox will popup with the value of the cell in column G (cell G10)

    Is this possible?

  2. #2
    Forum Expert
    Join Date
    07-31-2010
    Location
    California
    MS-Off Ver
    Excel 2007
    Posts
    4,070

    Re: Popup message showing adjacent cell value when user enters value in cell

    Try this:

    Private Sub Worksheet_Change(ByVal Target As Range)
    
    If Not Intersect(Target, Range("W8:W140")) Is Nothing Then
        If Not IsEmpty(Range("G" & Target.Row)) Then
            MsgBox (Range("G" & Target.Row).Value)
        End If
    End If
    
    End Sub

  3. #3
    Valued Forum Contributor
    Join Date
    09-21-2011
    Location
    Birmingham UK
    MS-Off Ver
    Excel 2003/7/10
    Posts
    2,188

    Re: Popup message showing adjacent cell value when user enters value in cell

    Private Sub Worksheet_Change(ByVal Target As Range)
    
    
    Dim rIntersect As Excel.Range
    
    Set rIntersect = Intersect(Target, Range("D1:D100"))
    
    If Not rIntersect Is Nothing Then
    
        If Cells(Target.Row, 7).Value <> "" Then
            
            MsgBox "VALUE IN G IS " & Cells(Target.Row, 7).Value
        
        End If
    
    End If
    
    
    
    End Sub
    Hope this helps

    Sometimes its best to start at the beginning and learn VBA & Excel.

    Please dont ask me to do your work for you, I learnt from Reading books, Recording, F1 and Google and like having all of this knowledge in my head for the next time i wish to do it, or wish to tweak it.
    Available for remote consultancy work PM me

  4. #4
    Valued Forum Contributor
    Join Date
    09-21-2011
    Location
    Birmingham UK
    MS-Off Ver
    Excel 2003/7/10
    Posts
    2,188

    Re: Popup message showing adjacent cell value when user enters value in cell

    i used D for my inspection range, not W too lazy to scroll over

  5. #5
    Registered User
    Join Date
    10-09-2013
    Location
    UK
    MS-Off Ver
    Excel 2003
    Posts
    13

    Re: Popup message showing adjacent cell value when user enters value in cell

    Both solutions are working when I enter a value. many thanks!
    the problem is when I select a cell in column W and hit the delete button to clear the value, I get a Run Time Error '1004' Application-defined or object defined error on the msgbox line

+ 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] VBA - Popup message when user selects a Protected Cell
    By elliotencore in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 06-27-2013, 03:55 AM
  2. Replies: 0
    Last Post: 10-30-2012, 03:48 PM
  3. [SOLVED] MsgBox popup when user enters a value in a cell
    By okelly in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 04-26-2012, 01:00 PM
  4. Replies: 2
    Last Post: 08-06-2008, 02:09 PM
  5. [SOLVED] How to run a macro when user enters a value in a cell?
    By serdar in forum Excel General
    Replies: 5
    Last Post: 06-05-2005, 09: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