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: 553
Default Search Modules for Cell Addresses in Range Variables

I want to check and see if a cell address is referenced in VBA code So lets
say I have a macro in my Personal wkbk or XLA that allows me to open the
target model (wkbk1). Upon opening this workbook, I want to test to see if
wrbk1 has code modules. Then I want to test to see if it has range
variabless. These range variales could come in several forms. They might
be direct examples like EXAMPLE 1 below. Or the could be ranges which are
included in a broader range as in EXAMPLE 2. Or they could be ranges that
includes via a Method as in EXAMPLE 3. I can search the text of the module
for EXAMPLE 1. For Example 2 I neeed to evaluate the SUM function and test to
see if my cell address is in the range. How do you do this? It's almost the
reverse of the Union function. I need to break out the indivdual addresses
in a range. For Example 3 I need to be able to walk through the OFFSET
Method and test the value of the variable Var1. Is there a way to do this
(i.e. can you walk through the code of a target module without acutally
running that code to test variable values?)?

EXAMPLE 1
Var1 = Range("Sheet1!A1")

EXAMPLE 2
Var1 = Application.WorkbookFunction.Sum(Range("Sheet!A1:A 5")

EXAMPLE 3
Var1 = Range("Sheet1!A1").Offset(0,X)


Thanks

EM
 
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
Calling Public Variables between diff Modules J@Y Excel Programming 3 July 4th 07 06:16 PM
Sub(), Modules, and Private/ Global variables J@Y Excel Programming 4 June 22nd 07 09:50 PM
Passing Variables within For loops to other modules tomjermy Excel Programming 1 August 22nd 06 06:07 PM
Private modules and global variables davidm Excel Programming 6 November 25th 05 07:10 PM
Need help with adding variables to cell addresses Matt[_33_] Excel Programming 14 October 11th 05 11:46 PM


All times are GMT +1. The time now is 03:35 AM.

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

About Us

"It's about Microsoft Excel"