+ Reply to Thread
Results 1 to 8 of 8

Event Macro to display a selected cell in target cell

  1. #1
    Registered User
    Join Date
    09-15-2012
    Location
    Melbourne, Australia
    MS-Off Ver
    Excel Mac 2011
    Posts
    10

    Event Macro to display a selected cell in target cell

    Hi All,

    Long time user first time poster!

    I am creating a spreadsheet for my school and have come to a dead end.

    I need to create a macro that when a user double clicks or right clicks on a cell in the first row of "Sheet 1", Cell A1 displays the contents of a cell in same cell as the one double clicked in a different worksheet.

    For example

    I double click cell B1 in Sheet 1, and cell A1 displays the contents of cell B1 in sheet2.

    Any help would be greatly appreciated!

    Thanks in advance

  2. #2
    Valued Forum Contributor
    Join Date
    08-14-2012
    Location
    India
    MS-Off Ver
    Excel 2007
    Posts
    573

    Re: Event Macro to display a selected cell in target cell

    You can place this macro in the sheet1's code and try if it would help.
    Please Login or Register  to view this content.
    Regards,
    Sindhu

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

    Re: Event Macro to display a selected cell in target cell

    Sorry,

    misread the OP demands.

    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

  4. #4
    Registered User
    Join Date
    09-15-2012
    Location
    Melbourne, Australia
    MS-Off Ver
    Excel Mac 2011
    Posts
    10

    Re: Event Macro to display a selected cell in target cell

    Thanks Sindhus,

    It works a charm when my worksheet is not protected but i get a runtime error when it is protected.

    Any suggestions?

  5. #5
    Valued Forum Contributor
    Join Date
    08-14-2012
    Location
    India
    MS-Off Ver
    Excel 2007
    Posts
    573

    Re: Event Macro to display a selected cell in target cell

    But you cannot double click on the sheet, when it is protected right?

  6. #6
    Registered User
    Join Date
    09-15-2012
    Location
    Melbourne, Australia
    MS-Off Ver
    Excel Mac 2011
    Posts
    10

    Re: Event Macro to display a selected cell in target cell

    I can if the cells are not locked

  7. #7
    Valued Forum Contributor
    Join Date
    08-14-2012
    Location
    India
    MS-Off Ver
    Excel 2007
    Posts
    573

    Re: Event Macro to display a selected cell in target cell

    Ya. Then You mean to say you are double clicking on the unlocked cells? Then make sure Range("A1") is also unlocked. Because the macro writes in A1 cell.

  8. #8
    Registered User
    Join Date
    09-15-2012
    Location
    Melbourne, Australia
    MS-Off Ver
    Excel Mac 2011
    Posts
    10

    Re: Event Macro to display a selected cell in target cell

    Sindhus you are a legend!

    Thanks for your assistance

+ 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