+ Reply to Thread
Results 1 to 8 of 8

Need cell address

  1. #1
    Registered User
    Join Date
    07-11-2012
    Location
    New York
    MS-Off Ver
    Excel 2010
    Posts
    50

    Need cell address

    Hello,

    I am using the following code to call a macro whenever one of the key cells is changed

    Please Login or Register  to view this content.
    I would like a to be the cell address of the cell that changed. I then need to know how to use the variable a within my macro.

    If that doesnt make sense I can try to explain more.

    Thanks.

  2. #2
    Forum Guru HaHoBe's Avatar
    Join Date
    02-19-2005
    Location
    Hamburg, Germany
    MS-Off Ver
    work: 2016 on Win10 (notebook), private: 365 on Win11 (desktop), 2019 on Win11 (notebook)
    Posts
    8,198

    Re: Need cell address

    Hi, Ferloft,

    what´s Macro1 purpose as it is called prior to setting a? Usually you refer to the cells from the sheet the event is called from:

    Please Login or Register  to view this content.
    Ciao,
    Holger
    Use Code-Tags for showing your code: [code] Your Code here [/code]
    Please mark your question Solved if there has been offered a solution that works fine for you

  3. #3
    Forum Expert
    Join Date
    07-15-2012
    Location
    Leghorn, Italy
    MS-Off Ver
    Excel 2010
    Posts
    3,431

    Re: Need cell address

    Please Login or Register  to view this content.
    If solved remember to mark Thread as solved

  4. #4
    Registered User
    Join Date
    07-11-2012
    Location
    New York
    MS-Off Ver
    Excel 2010
    Posts
    50

    Re: Need cell address

    I just added a in there I have no idea if thats where it should actually go. Essentially whenever one of the cells in the KeyCells range is changed I want Macro1 to run. However at the end of Macro1 I would like the last step to be select the cell below whichever cell was changed.

    patel: It didn't like me taking out the .Address part of finding the intersect. When I put it back in it still didn't set a to the cell that changed.
    Last edited by Ferloft; 06-28-2013 at 08:28 AM.

  5. #5
    Forum Guru HaHoBe's Avatar
    Join Date
    02-19-2005
    Location
    Hamburg, Germany
    MS-Off Ver
    work: 2016 on Win10 (notebook), private: 365 on Win11 (desktop), 2019 on Win11 (notebook)
    Posts
    8,198

    Re: Need cell address

    Hi, Ferloft,

    maybe like this
    Please Login or Register  to view this content.
    Ciao,
    Holger

  6. #6
    Forum Expert nilem's Avatar
    Join Date
    10-22-2011
    Location
    Ufa, Russia
    MS-Off Ver
    2013
    Posts
    3,377

    Re: Need cell address

    Hi Ferloft
    I try to guess
    maybe something like
    Please Login or Register  to view this content.

  7. #7
    Registered User
    Join Date
    07-11-2012
    Location
    New York
    MS-Off Ver
    Excel 2010
    Posts
    50

    Re: Need cell address

    That one seems to be working Holger, thanks! I will mark the thread as solved and if I run into any problems I'll make sure to come back.

    Just out of curiosity, why do you turn off events while selecting the cell?

  8. #8
    Forum Guru HaHoBe's Avatar
    Join Date
    02-19-2005
    Location
    Hamburg, Germany
    MS-Off Ver
    work: 2016 on Win10 (notebook), private: 365 on Win11 (desktop), 2019 on Win11 (notebook)
    Posts
    8,198

    Re: Need cell address

    Hi, Ferloft,

    a habit of mine from the days of using Excel2000 (it could lead to endless loops there - better excuse than stating I just forgot what event I was handling ): this will not get the event fired in case any cursor movement (SelectionChange) or action (Change) has taken place. May be omitted here (both of the lines).

    Ciao,
    Holger

+ 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