+ Reply to Thread
Results 1 to 5 of 5

Extending a Private Sub Worksheet?

  1. #1
    Registered User
    Join Date
    10-04-2012
    Location
    Newcastle
    MS-Off Ver
    Excel 2003
    Posts
    12

    Post Extending a Private Sub Worksheet?

    Hi Guys,

    First I would like to thank you in advance- I know what a help this forum is and it has come to my rescue more times than I have had hot baths.

    I am trying to use a macro on my excel sheet. And that lies my problem as I am relatively inexperienced with VBA.

    My question- I have used a macro from this site http://excel.tips.net/T003283_Hiding...ell_Value.html) and adapted it for my sheet. See below)


    Please Login or Register  to view this content.
    I would like to add another instance of this (see below)

    Please Login or Register  to view this content.
    But when I paste it below it - it wont work?

    Apologies for being ultra new!

    Thanks in advance

    Hernan
    Last edited by Richard Buttrey; 10-18-2012 at 09:33 AM.

  2. #2
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    45,264

    Re: Extending a Private Sub Worksheet?

    It's an Event macro so it needs to be in a Sheet Class module (the sheet where the selection/changes happen), NOT a standard module. Where have you pasted it?


    Regards, TMS
    Trevor Shuttleworth - Retired Excel/VBA Consultant

    I dream of a better world where chickens can cross the road without having their motives questioned

    'Being unapologetic means never having to say you're sorry' John Cooper Clarke


  3. #3
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    45,264

    Re: Extending a Private Sub Worksheet?

    Please Login or Register  to view this content.

    Regards, TMS

  4. #4
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: Extending a Private Sub Worksheet?

    Hi, and welcome to the forum,

    Unfortunately your post does not comply with Rule 3 of our Forum RULES. Use code tags around code. Posting code without them makes your code hard to read and difficult to be copied for testing. Highlight your code and click the # at the top of your post window. For more information about these and other tags, found here

    Since this is your first post, on this occasion I'll change it for you, but please note for the future.

    All the sheet events, like the Selection_Change events you mention are 'inbuilt'. i.e. they're not macro code which you can treat like any other procedure you want to write. There is only one Selection_Change event and therefore you need to include all your code within the single procedure.


    Please Login or Register  to view this content.
    Last edited by Richard Buttrey; 10-18-2012 at 09:34 AM.
    Richard Buttrey

    RIP - d. 06/10/2022

    If any of the responses have helped then please consider rating them by clicking the small star icon below the post.

  5. #5
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    45,264

    Re: Extending a Private Sub Worksheet?

    Thanks for the rep.


    If you are satisfied with the solution(s) provided, please mark your thread as Solved.


    New quick method:
    Select Thread Tools-> Mark thread as Solved. To undo, select Thread Tools-> Mark thread as Unsolved.

    Or you can use this way:

    How to mark a thread Solved
    Go to the first post
    Click edit
    Click Go Advanced
    Just below the word Title you will see a dropdown with the word No prefix.
    Change to Solved
    Click Save

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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