+ Reply to Thread
Results 1 to 2 of 2

Worksheet Code Too Large

  1. #1
    Paige
    Guest

    Worksheet Code Too Large

    I'm sure this is a stupid question. I have Private Sub
    Worksheet_SelectionChange(ByVal Target As Range) and Private Sub
    Worksheet_Change(ByVal Target As Range) code in a worksheet object, but the
    module is too large. How do I divy this up? I know how to break the other
    'regular' modules up, but can't figure out how to do a worksheet object.

  2. #2
    Bob Phillips
    Guest

    Re: Worksheet Code Too Large

    That is very difficult to say without seeing the code, but in principle, you
    need to identify a discreet block of code and move it into a separate macro
    in a standard code module. When you do so, make sure you maintain a link to
    the worksheet, which is implicit in the worksheet event code.

    Then repeat the process until you can see no more.

    You could also check to see whether there is any unnecessary code in the
    procedures, or duplicated code that could be moved to a separate macro.

    --

    HTH

    RP
    (remove nothere from the email address if mailing direct)


    "Paige" <[email protected]> wrote in message
    news:[email protected]...
    > I'm sure this is a stupid question. I have Private Sub
    > Worksheet_SelectionChange(ByVal Target As Range) and Private Sub
    > Worksheet_Change(ByVal Target As Range) code in a worksheet object, but

    the
    > module is too large. How do I divy this up? I know how to break the

    other
    > 'regular' modules up, but can't figure out how to do a worksheet object.




+ 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