Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Old November 18th 19, 09:14 PM posted to microsoft.public.excel.programming
external usenet poster
 
First recorded activity by ExcelBanter: Apr 2018
Posts: 11
Default VBA "=STEP" equivalent

For years all macros I wrote for Excel were in XLM code. Trying to learn VBA and would like to know if there is a VBA equivalent to the "=STEP()" statement in XLM, which is very useful in debugging.

Can someone please indicate what the corresponding code is for VBA? Many thanks.

  #2   Report Post  
Old November 19th 19, 01:57 AM posted to microsoft.public.excel.programming
external usenet poster
 
First recorded activity by ExcelBanter: Apr 2015
Posts: 1,083
Default VBA "=STEP" equivalent

For years all macros I wrote for Excel were in XLM code. Trying to learn VBA
and would like to know if there is a VBA equivalent to the "=STEP()"
statement in XLM, which is very useful in debugging.

Can someone please indicate what the corresponding code is for VBA? Many
thanks.


Unable to find any reference resources for XLM Step(); - can you point or OR
explain what it does?

--
Garry

Free usenet access at http://www.eternal-september.org
Classic VB Users Regroup!
comp.lang.basic.visual.misc
microsoft.public.vb.general.discussion
  #3   Report Post  
Old November 19th 19, 07:21 PM posted to microsoft.public.excel.programming
external usenet poster
 
First recorded activity by ExcelBanter: Apr 2018
Posts: 11
Default VBA "=STEP" equivalent

On Monday, November 18, 2019 at 6:57:22 PM UTC-6, GS wrote:
For years all macros I wrote for Excel were in XLM code. Trying to learn VBA
and would like to know if there is a VBA equivalent to the "=STEP()"
statement in XLM, which is very useful in debugging.

Can someone please indicate what the corresponding code is for VBA? Many
thanks.


Unable to find any reference resources for XLM Step(); - can you point or OR
explain what it does?

--
Garry

Free usenet access at http://www.eternal-september.org
Classic VB Users Regroup!
comp.lang.basic.visual.misc
microsoft.public.vb.general.discussion


It's a macro function for Excel 4.0 (yes, really old!)

As described in the manual:

"Stops the normal flow of a macro and calculates it one cell at a time. Running a macro one cell at a time is called single-stepping and is very useful when you are debugging a macro."

At each step it gives user the option to continue stepping, or running the rest of the macro normally, without interruption.

Hopefully this describes it. I appreciate your help, Garry.
  #4   Report Post  
Old November 19th 19, 07:46 PM posted to microsoft.public.excel.programming
external usenet poster
 
First recorded activity by ExcelBanter: Apr 2015
Posts: 1,083
Default VBA "=STEP" equivalent

On Monday, November 18, 2019 at 6:57:22 PM UTC-6, GS wrote:
For years all macros I wrote for Excel were in XLM code. Trying to learn
VBA and would like to know if there is a VBA equivalent to the "=STEP()"
statement in XLM, which is very useful in debugging.

Can someone please indicate what the corresponding code is for VBA? Many
thanks.


Unable to find any reference resources for XLM Step(); - can you point or OR
explain what it does?

--
Garry

Free usenet access at http://www.eternal-september.org
Classic VB Users Regroup!
comp.lang.basic.visual.misc
microsoft.public.vb.general.discussion


It's a macro function for Excel 4.0 (yes, really old!)

As described in the manual:

"Stops the normal flow of a macro and calculates it one cell at a time.
Running a macro one cell at a time is called single-stepping and is very
useful when you are debugging a macro."

At each step it gives user the option to continue stepping, or running the
rest of the macro normally, without interruption.

Hopefully this describes it. I appreciate your help, Garry.


That's what I suspected it was based on unclear info found online. I started
programming Excel with Office 2000 Developer Edition so I know nothing of XLM
macros.

In VBA you can step thru code 1 line at a time, whether it's part of a loop or
just executable line after executable line using F8. For example:

Dim vData, rng, n&, k&
vData = ActiveSheet.UsedRange

'Step through 1 cell at a time
For Each rng in ActiveSheet.UsedRange
Debug.Print rng.Value
Next 'rng

'Step through 1 row at a time
For n = LBound(vData) to UBound(vData)
'Step through 1 col at a time
For k = LBound(vData) to UBound(vData, 2)
Debug.Print vData(n, k)
Next 'k
Next 'n

There's also a Step function for loops using a counter:

'Grab data from every other col
For n = LBound(vData) to UBound(vData)
For k = LBound(vData) to UBound(vData, 2) Step 2
Debug.Print vData(n, k)
Next 'k
Next 'n

'Grab data from every other row
For n = LBound(vData) to UBound(vData) Step 2
'Step through 1 col at a time
For k = LBound(vData) to UBound(vData, 2)
Debug.Print vData(n, k)
Next 'k
Next 'n

HTH

--
Garry

Free usenet access at http://www.eternal-september.org
Classic VB Users Regroup!
comp.lang.basic.visual.misc
microsoft.public.vb.general.discussion
  #5   Report Post  
Old November 19th 19, 08:52 PM posted to microsoft.public.excel.programming
external usenet poster
 
First recorded activity by ExcelBanter: Apr 2018
Posts: 11
Default VBA "=STEP" equivalent

On Tuesday, November 19, 2019 at 12:46:27 PM UTC-6, GS wrote:
On Monday, November 18, 2019 at 6:57:22 PM UTC-6, GS wrote:
For years all macros I wrote for Excel were in XLM code. Trying to learn
VBA and would like to know if there is a VBA equivalent to the "=STEP()"
statement in XLM, which is very useful in debugging.

Can someone please indicate what the corresponding code is for VBA? Many
thanks.

Unable to find any reference resources for XLM Step(); - can you point or OR
explain what it does?

--
Garry

Free usenet access at http://www.eternal-september.org
Classic VB Users Regroup!
comp.lang.basic.visual.misc
microsoft.public.vb.general.discussion


It's a macro function for Excel 4.0 (yes, really old!)

As described in the manual:

"Stops the normal flow of a macro and calculates it one cell at a time.
Running a macro one cell at a time is called single-stepping and is very
useful when you are debugging a macro."

At each step it gives user the option to continue stepping, or running the
rest of the macro normally, without interruption.

Hopefully this describes it. I appreciate your help, Garry.


That's what I suspected it was based on unclear info found online. I started
programming Excel with Office 2000 Developer Edition so I know nothing of XLM
macros.

In VBA you can step thru code 1 line at a time, whether it's part of a loop or
just executable line after executable line using F8. For example:

Dim vData, rng, n&, k&
vData = ActiveSheet.UsedRange

'Step through 1 cell at a time
For Each rng in ActiveSheet.UsedRange
Debug.Print rng.Value
Next 'rng

'Step through 1 row at a time
For n = LBound(vData) to UBound(vData)
'Step through 1 col at a time
For k = LBound(vData) to UBound(vData, 2)
Debug.Print vData(n, k)
Next 'k
Next 'n

There's also a Step function for loops using a counter:

'Grab data from every other col
For n = LBound(vData) to UBound(vData)
For k = LBound(vData) to UBound(vData, 2) Step 2
Debug.Print vData(n, k)
Next 'k
Next 'n

'Grab data from every other row
For n = LBound(vData) to UBound(vData) Step 2
'Step through 1 col at a time
For k = LBound(vData) to UBound(vData, 2)
Debug.Print vData(n, k)
Next 'k
Next 'n

HTH

--
Garry


OK I'll try this. Thanks again for your helpfulness & patience.


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
COUNTIFS equivalent in Excel 2003 - both criteria have text, one has "wildcard" Courtney[_3_] Excel Worksheet Functions 3 April 20th 10 03:01 AM
Querytables WebTables equivalent for InternetExplorer.Application.Document.all()="HTMLTable" [email protected] Excel Programming 3 August 27th 09 01:00 AM
Excel 2007 ribbon Controls & "My.Settings" equivalent in VBA rogge Excel Programming 0 January 9th 09 12:33 AM
Is there an Excel 2003 equivalent to Word's "versions" function? Steve Excel Discussion (Misc queries) 0 March 4th 07 03:01 AM
shortcut key to see a macro running "step by step" al007 Excel Programming 1 November 10th 05 11:18 PM


All times are GMT +1. The time now is 02:32 PM.

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

About Us

"It's about Microsoft Excel"

 

Copyright © 2017