+ Reply to Thread
Results 1 to 6 of 6

Multiple Private subs

  1. #1
    Registered User
    Join Date
    12-14-2011
    Location
    London, England
    MS-Off Ver
    Excel 2003
    Posts
    28

    Multiple Private subs

    Hiya,

    I am new to the forum!

    I am having an issue with my code that I have stored in the This Workbook Object - I have put together a Private Sub Workbook_Open and a Private Sub Workbook_SheetChange. Before it has finished running through the code in the workbook open sub, it seems to jump into the code for the workbook sheet change sub (seems to be each time it hits the Then part of a If condition).

    Is this a general issue in VBA or is this something to do with the way I have written my code?

    Thanks for your time.

    Lou
    Last edited by LouiseH24; 12-15-2011 at 11:16 AM.

  2. #2
    Forum Guru
    Join Date
    08-26-2007
    Location
    London
    Posts
    4,606

    Re: Multiple Private subs

    I expect something in the Open code affects a sheet. Can you post your code?

  3. #3
    Registered User
    Join Date
    12-14-2011
    Location
    London, England
    MS-Off Ver
    Excel 2003
    Posts
    28

    Re: Multiple Private subs

    Sure thing:

    Please Login or Register  to view this content.
    I apologise if the code seems crude - I am new to private subs

  4. #4
    Forum Guru
    Join Date
    08-26-2007
    Location
    London
    Posts
    4,606

    Re: Multiple Private subs

    Try adding this line after your d=4 line and turning it back on at the end:
    Please Login or Register  to view this content.
    Btw you can dispense with most Selects, e.g.
    Please Login or Register  to view this content.

  5. #5
    Registered User
    Join Date
    12-14-2011
    Location
    London, England
    MS-Off Ver
    Excel 2003
    Posts
    28

    Re: Multiple Private subs

    Brilliant - thank you ever so much, I will give this a try

  6. #6
    Registered User
    Join Date
    12-14-2011
    Location
    London, England
    MS-Off Ver
    Excel 2003
    Posts
    28

    Re: Multiple Private subs

    Perfect this seems to have worked!!

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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