I have a code to auto-create a form, so at most it references some cells twice or 3 times to set the field name and maybe change font size or colour depending. In situations where it sets a value and changes the font, I can reference the range each time, yielding 2 lines of code, or I can use With
to reference it once but it totals 4 lines of code. Intuitively I think 2 lines are less than 4 but I'm a noob and I'm not sure if there is some efficiency in using With
that would add up if the entire script used it. Say for example:
Range("A1").value = "Hi"
Range("A1").font.size = 12
Vs
With Range("A1")
.value = "Hi"
.font.size = 12
End With
Which would be faster?