Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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 |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
COUNTIFS equivalent in Excel 2003 - both criteria have text, one has "wildcard" | Excel Worksheet Functions | |||
Querytables WebTables equivalent for InternetExplorer.Application.Document.all()="HTMLTable" | Excel Programming | |||
Excel 2007 ribbon Controls & "My.Settings" equivalent in VBA | Excel Programming | |||
Is there an Excel 2003 equivalent to Word's "versions" function? | Excel Discussion (Misc queries) | |||
shortcut key to see a macro running "step by step" | Excel Programming |