+ Reply to Thread
Results 1 to 3 of 3

Macro relative to a cell

Hybrid View

almoni Macro relative to a cell 08-13-2009, 11:43 AM
mrice Re: Macro relative to a cell 08-15-2009, 05:55 AM
almoni Re: Macro relative to a cell 08-16-2009, 04:04 AM
  1. #1
    Registered User
    Join Date
    08-13-2009
    Location
    Israel
    MS-Off Ver
    Excel 2003
    Posts
    2

    Macro relative to a cell

    Hi all,

    I've written a macro which executes a program when specific cell is double-clicked.( For example: A1 ).
    If I move the contents of the cell to any other position(A1 to B2), A1 is still the cell which
    executes a program.

    Is it possible to make the macro relative to the cell. In the other words: If I
    move the contents of A1 to B2 I want B2 be the cell which executes a program.


    On the other hand If you have any simple idea of executing programs with arguments by clicking on a cell?


    Thanks all,

    Daniel

  2. #2
    Forum Expert mrice's Avatar
    Join Date
    06-22-2004
    Location
    Surrey, England
    MS-Off Ver
    Excel 2013
    Posts
    4,967

    Re: Macro relative to a cell

    I guess that you could run the code when selecting any cell and get the code to quickly exit if the cell does not contain the value that you want.

  3. #3
    Registered User
    Join Date
    08-13-2009
    Location
    Israel
    MS-Off Ver
    Excel 2003
    Posts
    2

    Re: Macro relative to a cell

    Thanks for your reply.

    Actually I would like to manage a list of files in excel.

    Every time I click the name a program will be executed.

    The problem is that if I need to add or remove a file to/from the list, the macro still points to an original cell.

    What I need is:

    1. Recent situation: Cell Value of A2 is "File2"
    If I click it File 2 is executed
    2. Now I move "File2" to A3
    I need that if I click A3 File2 will be executed
    and not A2!


    Thanks again,

    Daniel

+ 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