Results 1 to 5 of 5

Change cell value from an Add-In

Threaded View

  1. #1
    Registered User
    Join Date
    02-10-2014
    Location
    Schaumburg, IL
    MS-Off Ver
    Excel 2007
    Posts
    24

    Change cell value from an Add-In

    I have a macro that runs OK when placed in a worksheet. This code will do the following in cell A1 of the “testx” worksheet: If cell A1 is empty when clicked, an “x” will become the value of cell A1, and if the value of cell A1 is “x” when clicked, the value of cell A1 will become “” (empty).

    I need to have this work from an Add-In so that when any workbook that references the Add-In and contains the worksheet “testx” cell A1 will either be empty or contain an “x” when clicked.

    I’ve checked the info at http://www.cpearson.com/excel/AppEvent.aspx, Pearson Software Consulting, and I did get the example to work, but I cannot get my code to work when I follow the example steps. I appreciate any help available.

    My code is as follows:

    Private Sub Worksheet_SelectionChange(ByVal Target As Excel.Range)
    Application.EnableEvents = False
    If Target.Address = Worksheets("testx").Range("A1").Address Then
    Select Case Target.Value
    Case "x"
    Target.Value = ""
    Case Else
    Target.Value = "x"
    End Select
    End If

    Application.EnableEvents = True
    End Sub
    Last edited by gdaniels; 05-01-2017 at 07:26 AM.

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Worksheet change event with multiple column cell value change
    By borgyang in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 09-29-2015, 11:53 AM
  2. [SOLVED] Change On_Open macro to a cell change in a range of cells
    By davidpierce in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 05-27-2015, 02:46 PM
  3. If range value change, active cell equal date and time of change.
    By kmakjop in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 03-31-2015, 02:43 PM
  4. auto change cell formula on condition of worksheet change in other cells
    By futurejock in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 06-01-2009, 12:11 AM
  5. Change Event doesn't change until I return to the Target Cell
    By carsto in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 07-11-2007, 05:20 PM
  6. [SOLVED] making copied cells change with change in original cell
    By Jennifer Mcdermeit in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 07-20-2006, 11:58 AM
  7. [SOLVED] Cell value change to trigger macro (worksheet change event?)
    By Neil Goldwasser in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 01-10-2006, 10:00 AM

Tags for this Thread

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