Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default How do I step a Macro through a spreadsheet


I am trying to find out what a particular macro does as it's not
behaving the way I would expect it to. How do I run it in "step Mode"
so I can see what each step is doing?

Sarah


--
Sarahds


------------------------------------------------------------------------
Sarahds's Profile: http://www.excelforum.com/member.php...o&userid=37005
View this thread: http://www.excelforum.com/showthread...hreadid=567313

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4,391
Default How do I step a Macro through a spreadsheet

First, it's easier to arrange the VBA IDE window and the Excel window so you
can see both at the both together.
Put a breakpoint on the line of code from which you want to start stepping
through: Left click in the left hand border of the window that contains the
code you want to examine. You will get a red dot in the border and that
whole line will have be red. It must be an executable line of code i.e NOT a
comment or Dim .
Trigger you code however it is supposed to start.
When you are in Break Mode (by your break point being reached, you can step
through the code line-by-line by pressing the F8 keys.
You can enter any valid code the Immediate (debug) window, to either set a
value or query a value, then press Enter:
To check:
?activecell.address [Enter]
To set
activecell.value="New Value" [Enter]

You can remove breakpoints by clicking on the red dot again.

Check out Debug in the VBA Help.

NickHK

"Sarahds" wrote in
message ...

I am trying to find out what a particular macro does as it's not
behaving the way I would expect it to. How do I run it in "step Mode"
so I can see what each step is doing?

Sarah


--
Sarahds


------------------------------------------------------------------------
Sarahds's Profile:

http://www.excelforum.com/member.php...o&userid=37005
View this thread: http://www.excelforum.com/showthread...hreadid=567313



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
run macro step by step. excel 2003 PBM[_3_] Excel Programming 2 November 19th 05 02:19 PM
shortcut key to see a macro running "step by step" al007 Excel Programming 1 November 10th 05 10:18 PM
running macro step by step different from normal run?? Rinze Smit Excel Programming 10 July 26th 05 03:35 PM
I need step by step instructions to create a macro for 10 imbedde. diana Excel Worksheet Functions 3 January 31st 05 01:56 AM
VBA macro step-by-step Louis[_2_] Excel Programming 3 November 15th 03 03:21 PM


All times are GMT +1. The time now is 11:42 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"