Peter has attended:
Excel VBA Intro Intermediate course
When do I use the with function
when do I use the with function
RE: when do I use the with function
Hi Peter
Thank you for your question.
The With construct is used to make code more readable and therefore easier to maintain.
Example that groups commands refereing to the Font of the selection
With Selection.Font
.Name = "Verdana"
.FontStyle = "Italic"
.Size = 14
.Strikethrough = False
.Superscript = False
.Subscript = False
.OutlineFont = False
.Shadow = False
.Underline = xlUnderlineStyleNone
End With
Regards
Laura GB