+ Reply to Thread
Results 1 to 7 of 7

Shapes, TopLeftCell. Row incorrect

  1. #1
    Forum Contributor
    Join Date
    03-11-2013
    Location
    United Kingdom
    MS-Off Ver
    Excel 2016 (among others!)
    Posts
    331

    Shapes, TopLeftCell. Row incorrect

    I've a spreadsheet with a sheet or two for each month of the year. The idea is the user has a menu page and using that sends them to the correct start sheet using just one macro so that the sheet can grow without doing a macro for each additional month. So the months are listed in column B and the buttons are in column C. I started with the first month to see if I could get it to work using a message box to show me it worked as expected. The code was:

    Please Login or Register  to view this content.
    So that gave me the correct row and cell. A bit of further coding and it was selecting the correct sheet. So I copied the shape and pasted it into the other rows.

    ON testing it then gave me the row of the first picture. If I deleted that it then gave me the number of the one now at the top, no matter which button I click on. I'm at a loss. ANyone got any ideas? TIA

  2. #2
    Forum Guru Andy Pope's Avatar
    Join Date
    05-10-2004
    Location
    Essex, UK
    MS-Off Ver
    O365
    Posts
    20,436

    Re: Shapes, TopLeftCell. Row incorrect

    did you change the names of the copied shapes?

    If they all have the same name then only the first, by zorder, will be returned
    Cheers
    Andy
    www.andypope.info

  3. #3
    Forum Expert
    Join Date
    02-22-2013
    Location
    London, UK
    MS-Off Ver
    Office 365
    Posts
    1,218

    Re: Shapes, TopLeftCell. Row incorrect

    Would this work (untested):
    Please Login or Register  to view this content.

  4. #4
    Forum Contributor
    Join Date
    03-11-2013
    Location
    United Kingdom
    MS-Off Ver
    Excel 2016 (among others!)
    Posts
    331

    Re: Shapes, TopLeftCell. Row incorrect

    Berlan - sorry - a typo there that wasn't actually in the code as it turns out.

    Andy - I wondered about that, but I can't find anywhere to change the name of the shape (I am far too used to older version of Excel to be using 365 for this!!)

  5. #5
    Forum Guru Andy Pope's Avatar
    Join Date
    05-10-2004
    Location
    Essex, UK
    MS-Off Ver
    O365
    Posts
    20,436

    Re: Shapes, TopLeftCell. Row incorrect

    Does ALT+F10 show the selection task pane?

    Also, doesn't the shape name appear in the Name Box next to the formula bar?

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

    Re: Shapes, TopLeftCell. Row incorrect

    You may select the shape and then overtype the name in the Name box at the left of the formula bar.
    • 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

  7. #7
    Forum Contributor
    Join Date
    03-11-2013
    Location
    United Kingdom
    MS-Off Ver
    Excel 2016 (among others!)
    Posts
    331

    Re: Shapes, TopLeftCell. Row incorrect

    Both legends! Thanks for that. Job done. Happy fella.

+ 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. Creating buttons using TopLeftCell
    By Ben F. in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 01-23-2013, 09:57 AM
  2. How To Move Shapes From Another Shapes? (floating shapes)
    By MarcLev in forum Word Programming / VBA / Macros
    Replies: 2
    Last Post: 10-04-2009, 04:04 PM
  3. problem w/ size of combobox & using TopLeftCell
    By Bill_excelforum in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 03-08-2006, 06:05 PM
  4. [SOLVED] range variable won't assign (chartobject.topleftcell property)
    By Matthew Dodds in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 11-16-2005, 10:30 AM
  5. [SOLVED] TopLeftCell.Address for buttons from forms toolbar
    By Andy in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 11-11-2005, 01:20 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