What does this macro code mean?
Closed
nbe9
Posts
3
Registration date
Tuesday April 19, 2016
Status
Member
Last seen
April 21, 2016
-
Apr 20, 2016 at 10:45 AM
nbe9 Posts 3 Registration date Tuesday April 19, 2016 Status Member Last seen April 21, 2016 - Apr 21, 2016 at 03:38 PM
nbe9 Posts 3 Registration date Tuesday April 19, 2016 Status Member Last seen April 21, 2016 - Apr 21, 2016 at 03:38 PM
Related:
- What does this macro code mean?
- Battery reset code - Guide
- Samsung volume increase code - Guide
- Cs 1.6 code - Guide
- How to get whatsapp verification code online - Guide
- Nokia factory reset code forgot - Guide
3 responses
Zohaib R
Posts
2368
Registration date
Sunday September 23, 2012
Status
Member
Last seen
December 13, 2018
69
Apr 20, 2016 at 12:01 PM
Apr 20, 2016 at 12:01 PM
Hi nbe9,
Please note that Range("A1").Select will take the Cursor to Cell A1 which is the beginning of the sheet. Indeed it is a good practice to place the Cursor at the beginning of the Sheet after the Macro execution has completed that's the reason it has been incorporated in this code.
Please note that Range("A1").Select will take the Cursor to Cell A1 which is the beginning of the sheet. Indeed it is a good practice to place the Cursor at the beginning of the Sheet after the Macro execution has completed that's the reason it has been incorporated in this code.
nbe9
Posts
3
Registration date
Tuesday April 19, 2016
Status
Member
Last seen
April 21, 2016
Apr 20, 2016 at 05:00 PM
Apr 20, 2016 at 05:00 PM
Hey Zohaib R,
Thanks that makes perfect sense! Follow up questions:
To make the macro stop at a specific row should I only change the "Row To 2" number?
To make the macro insert a different number of rows should I only change the "Nb = 4" number?
Thanks that makes perfect sense! Follow up questions:
To make the macro stop at a specific row should I only change the "Row To 2" number?
To make the macro insert a different number of rows should I only change the "Nb = 4" number?
Zohaib R
Posts
2368
Registration date
Sunday September 23, 2012
Status
Member
Last seen
December 13, 2018
69
Apr 21, 2016 at 01:52 AM
Apr 21, 2016 at 01:52 AM
Hi nbe9,
Sorry for the delayed response.
Range ("cellNumber") will not stop a Macro from executing. This only takes the Cursor to the specified location and executes operations on that selected range. There are are other ways of stopping a Macro from execution such as using an InputBox to receive user input before executing further or pressing the Esc key (if the code of the Macro is fairly long).
Yes, you can select a range and then perform the insert operation, it will execute on the selected range only.
Sorry for the delayed response.
Range ("cellNumber") will not stop a Macro from executing. This only takes the Cursor to the specified location and executes operations on that selected range. There are are other ways of stopping a Macro from execution such as using an InputBox to receive user input before executing further or pressing the Esc key (if the code of the Macro is fairly long).
Yes, you can select a range and then perform the insert operation, it will execute on the selected range only.
nbe9
Posts
3
Registration date
Tuesday April 19, 2016
Status
Member
Last seen
April 21, 2016
Apr 21, 2016 at 03:38 PM
Apr 21, 2016 at 03:38 PM
sorry I wasn't talking about changing the Range ("cellNumber"), I was referring to the part of the code that says
Row To 2 Step -1
Row To 2 Step -1