+ Reply to Thread
Results 1 to 5 of 5

Triggering an event from a cell

  1. #1
    Registered User
    Join Date
    12-20-2005
    Posts
    69

    Triggering an event from a cell

    Hi, is there a way that I can get my spreadsheet to trigger and event after a particular cell is updated?

  2. #2
    Forum Contributor VBA Noob's Avatar
    Join Date
    04-25-2006
    Location
    London, England
    MS-Off Ver
    xl03 & xl 07(Jan 09)
    Posts
    11,988
    Hi,

    Yes. Say B3 is updated this code will run a msgbox

    Please Login or Register  to view this content.
    Right click the sheet name that will need the code then paste into VB


    VBA Noob
    _________________________________________


    Credo Elvem ipsum etian vivere
    _________________________________________
    A message for cross posters

    Please remember to wrap code.

    Forum Rules

    Please add to your signature if you found this link helpful. Excel links !!!

  3. #3
    Registered User
    Join Date
    12-20-2005
    Posts
    69
    Brilliant, thanks for your help

  4. #4
    Registered User
    Join Date
    12-20-2005
    Posts
    69
    I now have another problem - I'm trying to get it so that when a value is entered in one cell it appears in another. However, I want it so the next time a value is entered in the first cell it adds it to the value in the second cell. The code I have tried (which is wrong) is the following:

    Private Sub Worksheet_Change(ByVal Target As Range)
    c3 = cells("c3").Value
    d3 = cells("d3").Value
    If Target.Address = "$d$3" Then
    c3 = cd + d3
    End If
    End Sub

    Can anybody tell me where I'm going wrong?

  5. #5
    Forum Contributor
    Join Date
    03-24-2005
    Location
    Wisconsin
    MS-Off Ver
    2007
    Posts
    378

    Use RANGE instead of CELLS???

    The syntax for CELLS is CELLS(Row,Column)

    The syntax for RANGE is RANGE("Address")

    I am also assuming there was a typo and the line
    c3 = cd + d3
    should have been
    c3 = c3 + d3
    Please Login or Register  to view this content.
    Thanks!
    Dennis

    I am using Windows 7 and Office 2007, all of my posts are based on this.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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