+ Reply to Thread
Results 1 to 6 of 6

Get cell address (range) from shape location

  1. #1
    Registered User
    Join Date
    09-30-2011
    Location
    California, USA
    MS-Off Ver
    Excel 2003
    Posts
    19

    Get cell address (range) from shape location

    This one should be easy but I keep running into trouble. Can someone please give me the proper syntax for getting the range of the topleftcell of a shape?

    I'm making a scheduling tool for work and I'm representing scheduled jobs on a calender by grouping a textbox (which fires a jobedit macro on click) and a rectangular frame (to enable user to drag the job to a different position in the schedule). The easy part is calling the names of all shapes on the sheet, and filtering them by type and name.

    For some reason, the hard part has been getting the address of the topleftcell of each job. I've been using some messy workarounds using .left and .top but I'd love to simplify the code by using range variables instead.
    Last edited by Fattyfatfat Kid; 07-30-2015 at 05:29 PM.

  2. #2
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678

    Re: Get cell address (range) from shape location

    Please Login or Register  to view this content.
    Entia non sunt multiplicanda sine necessitate

  3. #3
    Registered User
    Join Date
    09-30-2011
    Location
    California, USA
    MS-Off Ver
    Excel 2003
    Posts
    19

    Re: Get cell address (range) from shape location

    Okay, now how do I store that address into a Range variable?

    Stuff like this throws an error:
    Please Login or Register  to view this content.

  4. #4
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678

    Re: Get cell address (range) from shape location

    Object variables (and a range variable is one) require Set, and you want to assign the cell, not the address property (which is a string)

    Please Login or Register  to view this content.

  5. #5
    Registered User
    Join Date
    09-30-2011
    Location
    California, USA
    MS-Off Ver
    Excel 2003
    Posts
    19

    Re: Get cell address (range) from shape location

    There it is, many thanks!

  6. #6
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678

    Re: Get cell address (range) from shape location

    You're welcome.

+ 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. [SOLVED] Change cell value next to shape location
    By dravanderkruk in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 07-13-2015, 07:25 AM
  2. How to add to a particular cell location given by the formula =address(...)
    By weekssm in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 05-01-2014, 10:43 AM
  3. Assign macro with parameter to shape based on shape location
    By bobo3127 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 01-23-2014, 11:18 AM
  4. [SOLVED] Getting Shape location (range)
    By gjcase in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 05-31-2013, 06:13 PM
  5. Macro to paste shape in cell address - so close & yet...
    By jct in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 09-05-2008, 03:19 AM
  6. Replies: 10
    Last Post: 07-14-2006, 10:10 AM
  7. Cell Address Location
    By drizzt04240 in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 12-01-2005, 11:49 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