brothertruffle880
asked on
Excel VBA - Question about Syntax and the Language Structure
To protect and unprotect a sheet you write:
Sheet2.Protect
Sheet2.unProtect
So, how come the same rule doesn't apply to displaying page breaks? How come you have to write:
Sheet2.displayPageBreaks = True
Sheet2.displayPageBreaks = False
The following would make more sense given the grammar of the protect/unprotect statements.
Sheet2.displayPageBreaks
Sheet2.undisplayPageBreaks
I'm trying really hard to get a philosophical grip on the grammar of VBA and it's quite a chore. I'm looking for some threads of logic as to when I need to use "=true" or when I need to type a subscript like worksheets ("sheet1")
OR, do I just need to bite the bullet and memorize these language conjugations.
Sheet2.Protect
Sheet2.unProtect
So, how come the same rule doesn't apply to displaying page breaks? How come you have to write:
Sheet2.displayPageBreaks = True
Sheet2.displayPageBreaks = False
The following would make more sense given the grammar of the protect/unprotect statements.
Sheet2.displayPageBreaks
Sheet2.undisplayPageBreaks
I'm trying really hard to get a philosophical grip on the grammar of VBA and it's quite a chore. I'm looking for some threads of logic as to when I need to use "=true" or when I need to type a subscript like worksheets ("sheet1")
OR, do I just need to bite the bullet and memorize these language conjugations.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
You're welcome and I'm glad I was able to help.
Marty - MVP 2009 to 2013
Marty - MVP 2009 to 2013
ASKER
You explained it PERFECTLY. Now I'm starting to see the logic behind the language!
Thank you!