RIchavalues
New Member
- Joined
- Feb 24, 2016
- Messages
- 25
- Office Version
- 2019
- Platform
- Windows
Hi Experts,
Am sure this will be very easy for You all to explain but am having big trouble in understanding commands/methods.
For Example consider the below code:
I tried to write VBA that's dynamic (ie., by offset method) and hence somehow applied trial and error method to reach my goal and by far I know its not best practice.
So now I would like to know more on functionalities that "Cells" and "Range" have and what exactly last line of my code does. I will be glad if You can provide any reference where I will get examples and also explanation that each command does in VBA. (I tried to learn every command from msdn and am more confused than I understand). Please let me know if there are any books that explains in a way that a person having 0% knowledge on programming/vba can understand and write code independently.
PS: Am trying to apply auto indent to code and searched google for the same. Got to know about MZtools but can't figure out how to auto indent code. Am looking for something like select all the code and apply auto indent so that formatting of the code looks nice. ("Ctrl+A" To select all code AND "Ctrl+I" to auto indent). Like something we have in Java editor.
Regards,
Richa
Am sure this will be very easy for You all to explain but am having big trouble in understanding commands/methods.
For Example consider the below code:
Code:
Public previousCell As Range
Set previousCell = ActiveCell
ActiveCell.Offset(0, -1).Select
Range(Selection, Selection.Offset(0, 3)).Select
Range(prevCell.Offset(0, 0), prevCell.Offset(-1, 0)).Select
I tried to write VBA that's dynamic (ie., by offset method) and hence somehow applied trial and error method to reach my goal and by far I know its not best practice.
So now I would like to know more on functionalities that "Cells" and "Range" have and what exactly last line of my code does. I will be glad if You can provide any reference where I will get examples and also explanation that each command does in VBA. (I tried to learn every command from msdn and am more confused than I understand). Please let me know if there are any books that explains in a way that a person having 0% knowledge on programming/vba can understand and write code independently.
PS: Am trying to apply auto indent to code and searched google for the same. Got to know about MZtools but can't figure out how to auto indent code. Am looking for something like select all the code and apply auto indent so that formatting of the code looks nice. ("Ctrl+A" To select all code AND "Ctrl+I" to auto indent). Like something we have in Java editor.
Regards,
Richa