+ Reply to Thread
Results 1 to 7 of 7

Selection Value Change on Worksheet to Show / Hide a shape

  1. #1
    Registered User
    Join Date
    01-24-2016
    Location
    UK
    MS-Off Ver
    2016
    Posts
    60

    Selection Value Change on Worksheet to Show / Hide a shape

    Hi Folks,

    I get an error with the code below.

    its always on the else line.


    Please Login or Register  to view this content.
    I don't know what the problem is

    any idea
    thanks

    sl

  2. #2
    Forum Expert
    Join Date
    09-20-2011
    Location
    England
    MS-Off Ver
    Excel 2010
    Posts
    2,278

    Re: Selection Value Change on Worksheet to Show / Hide a shape

    Hello sl
    Your code works fine for me. Perhaps if you could upload a copy of the workbook with not confidential data someone might offer an answer to the problem.

    DBY

  3. #3
    Registered User
    Join Date
    01-24-2016
    Location
    UK
    MS-Off Ver
    2016
    Posts
    60

    Re: Selection Value Change on Worksheet to Show / Hide a shape

    Hello there,

    I have fiddled about and still no joy
    attached workbook
    thank you

    sl
    Attached Files Attached Files

  4. #4
    Forum Expert
    Join Date
    06-08-2012
    Location
    Left the forum!
    MS-Off Ver
    Left the forum!
    Posts
    5,189

    Re: Selection Value Change on Worksheet to Show / Hide a shape

    I get the error when the workbook first opens after downloading it from the forum, but other than that it works fine.

    Changing cell selection, no errors. Close file and open it again from excel file menu, no errors.

    Click the link to download again from the forum, error occurs.

    Maybe in certain conditions, the code triggers before the sheet is active, calling a shape that doesn't exist could trigger the error.

  5. #5
    Registered User
    Join Date
    01-24-2016
    Location
    UK
    MS-Off Ver
    2016
    Posts
    60

    Re: Selection Value Change on Worksheet to Show / Hide a shape

    Hi Jason,

    yes the error would trigger in some situations, that's why i Opened the thread, I was not sure what was triggering it.

    May be I will just use a button instead to show the shape
    oh well
    what can you do
    cheers
    sl

  6. #6
    Forum Expert
    Join Date
    06-08-2012
    Location
    Left the forum!
    MS-Off Ver
    Left the forum!
    Posts
    5,189

    Re: Selection Value Change on Worksheet to Show / Hide a shape

    I've been trying to cause errors in other situations with no luck, but did find that it is the wrong error for a missing shape, so we can eliminate that as the cause.

    Try changing ActiveSheet to Me and see if it errors then.

  7. #7
    Registered User
    Join Date
    01-24-2016
    Location
    UK
    MS-Off Ver
    2016
    Posts
    60

    Re: Selection Value Change on Worksheet to Show / Hide a shape

    Hi Jason,

    the problem was the activesheet, so I changed it to ME,and so far no problems.

    I found out when I hid the current work sheet that's when it triggered the error,
    thanks again
    sl

+ 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. Use a Shape as a Toggle Button to Show and Hide a Worksheet
    By HangMan in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 11-19-2015, 09:49 AM
  2. [SOLVED] Excel VBA hide / Show Shape
    By wambaugh in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 05-28-2015, 11:00 AM
  3. show hide shape to a cell problem with code
    By pavlos_x in forum Excel Programming / VBA / Macros
    Replies: 17
    Last Post: 03-26-2015, 02:43 PM
  4. [SOLVED] show hide shape to a cell according to its value
    By pavlos_x in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 03-14-2015, 05:34 PM
  5. Hide/show shape on Sheet1 based on cell value in Sheet2?
    By Guple in forum Excel Programming / VBA / Macros
    Replies: 10
    Last Post: 12-05-2013, 02:12 PM
  6. Show/Hide Shape VBA
    By maacmaac in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 01-06-2013, 09:03 AM
  7. [SOLVED] Show & Hide Shape in a Sheet
    By Pete Csiszar in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 01-14-2005, 10:07 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