+ Reply to Thread
Results 1 to 2 of 2

Referencing the object a macro is assigned to

  1. #1
    Registered User
    Join Date
    03-25-2013
    Location
    Canada
    MS-Off Ver
    Excel 2010
    Posts
    1

    Referencing the object a macro is assigned to

    In Excel 2010 how can I reference the object that a macro has been assigned to? I've created a spreadsheet with a form checkbox and assigned this macro to it:

    Please Login or Register  to view this content.
    The checkbox toggles whether or not a picture is visible and that's working fine but I'd like to reuse the script for multiple checkboxes.

    The above code is specifically targeting Checkbox1 but I'd like it to target "this", the object I've assigned the macro to.

    I feel like this should be really easy but I spent all evening on MSDN, excelforums.com and just googling around but couldn't find the solution.

    Thanks in advance!

  2. #2
    Forum Guru Izandol's Avatar
    Join Date
    03-29-2012
    Location
    *
    MS-Off Ver
    Excel 20(03|10|13)
    Posts
    2,581

    Re: Referencing the object a macro is assigned to

    You may use Application.Caller:

    Please Login or Register  to view this content.
    • Please remember to mark threads Solved with Thread Tools link at top of page.
    • Please use code tags when posting code: [code]Place your code here[/code]
    • Please read Forum Rules

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. "Formula is too complex to be assigned to object" ?
    By Markus Scheible in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 11-12-2013, 05:39 AM
  2. Referencing to chart object
    By Joaoack in forum Excel Programming / VBA / Macros
    Replies: 22
    Last Post: 04-26-2013, 11:29 AM
  3. [SOLVED] 424 Object Required error when referencing an array in a UDF
    By hadamhiram in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 04-25-2013, 11:02 PM
  4. Referencing the correct object in a formula
    By capnhud in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 06-21-2010, 06:03 PM
  5. Referencing Object Names with Variable
    By jbl25 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 08-25-2005, 08:05 PM

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