Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 110
Default Mapping the macro path

Is there a tool to map the path a macro takes through all it's procedures?

I have done a particularly ugly job of creating a macro-intensive
spreadsheet over the past 3 years. In fact, I challenge you to think of a
single VBA-Best-Practive that I have competently implemented in this
spreadsheet. Truly, I should be sent to Notepad and told to stay there for
the rest of my life. I would have gotten away with my abuse, but now I have
to share the spreadsheet with a more proficient programmer.

But perhaps you can help. Is there a tool that will map the complex paths
taken by the various procedures when the start button is pushed?

Or, failing that, is there a single line of code that I can copy to every
procedure that will return the procedure name to a cell as it runs?
Something like:

Sheets("MapPath").Range("A1").end(xlDown).offset(1 ,0).value =
CurrentMacro.Name

Any help appreciated.

regards
Daniel
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 192
Default Mapping the macro path

Hi Dan,

Two easy ways to monitor what your macro is doing is using the step function
(found in the debug toolbar) and the other is using "breakpoints" by right
clicking the small space between the project viewer and the macro area.
Stepping through (also you can use "F8") goes through the program step by
step and the breakpoints stop the code so you can see where things are at
wherever the code reaches the breakpoint. Whenever you're in the middle of
the code, you can hover your mouse over different variables and procedures to
see which values are assigned to different code.

Hope this helps!!

PS. Any code that works is good code. Someone may be able to make it look
better or run a little faster, but working code is good code. ;)
--
-SA


"Daniel Bonallack" wrote:

Is there a tool to map the path a macro takes through all it's procedures?

I have done a particularly ugly job of creating a macro-intensive
spreadsheet over the past 3 years. In fact, I challenge you to think of a
single VBA-Best-Practive that I have competently implemented in this
spreadsheet. Truly, I should be sent to Notepad and told to stay there for
the rest of my life. I would have gotten away with my abuse, but now I have
to share the spreadsheet with a more proficient programmer.

But perhaps you can help. Is there a tool that will map the complex paths
taken by the various procedures when the start button is pushed?

Or, failing that, is there a single line of code that I can copy to every
procedure that will return the procedure name to a cell as it runs?
Something like:

Sheets("MapPath").Range("A1").end(xlDown).offset(1 ,0).value =
CurrentMacro.Name

Any help appreciated.

regards
Daniel

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,420
Default Mapping the macro path

Daniel,

I have some code that adds a procedure name to all procedures, it could
easily be adapted to write a trace statement in the procedure instead.

Drop me an email offline, saying whether you want it to write to the debug
window (may overflow quickly), a spreadsheet, a text file or whatever, and I
will knock you up a little prototype.

BTW, that will teach you to employ more proficient coders <g.

--
__________________________________
HTH

Bob

"Daniel Bonallack" wrote in
message ...
Is there a tool to map the path a macro takes through all it's procedures?

I have done a particularly ugly job of creating a macro-intensive
spreadsheet over the past 3 years. In fact, I challenge you to think of a
single VBA-Best-Practive that I have competently implemented in this
spreadsheet. Truly, I should be sent to Notepad and told to stay there
for
the rest of my life. I would have gotten away with my abuse, but now I
have
to share the spreadsheet with a more proficient programmer.

But perhaps you can help. Is there a tool that will map the complex paths
taken by the various procedures when the start button is pushed?

Or, failing that, is there a single line of code that I can copy to every
procedure that will return the procedure name to a cell as it runs?
Something like:

Sheets("MapPath").Range("A1").end(xlDown).offset(1 ,0).value =
CurrentMacro.Name

Any help appreciated.

regards
Daniel



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 110
Default Mapping the macro path

Thanks Bob! Will e-mail you now.

"Bob Phillips" wrote:

Daniel,

I have some code that adds a procedure name to all procedures, it could
easily be adapted to write a trace statement in the procedure instead.

Drop me an email offline, saying whether you want it to write to the debug
window (may overflow quickly), a spreadsheet, a text file or whatever, and I
will knock you up a little prototype.

BTW, that will teach you to employ more proficient coders <g.

--
__________________________________
HTH

Bob

"Daniel Bonallack" wrote in
message ...
Is there a tool to map the path a macro takes through all it's procedures?

I have done a particularly ugly job of creating a macro-intensive
spreadsheet over the past 3 years. In fact, I challenge you to think of a
single VBA-Best-Practive that I have competently implemented in this
spreadsheet. Truly, I should be sent to Notepad and told to stay there
for
the rest of my life. I would have gotten away with my abuse, but now I
have
to share the spreadsheet with a more proficient programmer.

But perhaps you can help. Is there a tool that will map the complex paths
taken by the various procedures when the start button is pushed?

Or, failing that, is there a single line of code that I can copy to every
procedure that will return the procedure name to a cell as it runs?
Something like:

Sheets("MapPath").Range("A1").end(xlDown).offset(1 ,0).value =
CurrentMacro.Name

Any help appreciated.

regards
Daniel




Reply
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
2 questions: Macro Mapping & Active Chart Mike Excel Programming 0 July 18th 07 03:14 PM
path xml mapping DavidH&P Excel Programming 0 June 7th 06 08:10 AM
Macro to copy columns from 1st sheet to 2nd according to mapping-p Pawan Excel Programming 2 June 22nd 05 05:53 AM
Mapping macro Juan Pablo González Excel Programming 0 February 1st 04 07:57 PM
Mapping a drive through a macro Marino13[_4_] Excel Programming 1 January 12th 04 10:54 PM


All times are GMT +1. The time now is 07:09 PM.

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"