LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 97
Default Check for unnecessary Public variable declarations and duplicate Set statements

I already use Rob Bovey's excellent code cleaner [
http://www.appspro.com/Utilities/CodeCleaner.htm ] but I was wondering
whether something exists that checks for duplicate Set statements and
unnecessarily declared variables in a project?

I have a project that has evolved over a couple of weeks, and I've refined
it to be a lot smaller than it once was. The code is spread across 12
modules and I declare all the variables as Public in a module on their own.
The variables are mostly Workbooks, Worksheets and Ranges, but there are
also Integers and Longs, and there are a lot of them (100+). I know that
some of the variables aren't actually used in any of the modules, after the
refining that I've done to the project over the weeks.

The code is made up of one or two Sub procedures per module - some very
long - with a master Sub calling the other Subs in sequence. During testing
of the separate procedures I've had to copy in a lot of the Set statements
(to define Workbook, Worksheet and Range variables) at various points in
each procedure, so that I can test each Sub in isolation. But now that the
Project is finished I've put all these Set statements at the beginning of
the master Sub, which means that they're not now needed in the individual
Subs.

Short of using the Find tool in the VBE to look for unused variables and
duplicate Set statements, is there a quick of doing this?

TIA

Ian

 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Public Variable Marvin Excel Programming 1 March 29th 07 09:50 PM
Public variable Eric[_35_] Excel Programming 7 March 18th 07 06:54 AM
Declarations Procedure and Duplicate Declarations Neal Zimm Excel Programming 3 May 31st 05 01:01 AM
Check to see if variable is duplicate. ianripping[_59_] Excel Programming 7 May 8th 04 11:37 AM
Strange variable declarations Steven Revell Excel Programming 1 August 19th 03 02:19 PM


All times are GMT +1. The time now is 02:11 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"