ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Worksheet Code Too Large (https://www.excelbanter.com/excel-programming/343735-worksheet-code-too-large.html)

Paige

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.

Bob Phillips[_6_]

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" wrote in message
...
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.





All times are GMT +1. The time now is 12:28 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com