Hello!
I have two simple sample pieces of code. They both do the same thing and they both work. My question is: which is correct? The second example is less text. Does that make it run any faster? Is there a downside?
Also related, I've noticed that this code works:
...and so does this:
The second example is "cleaner," but is it any more efficient (speed-wise)?
I have two simple sample pieces of code. They both do the same thing and they both work. My question is: which is correct? The second example is less text. Does that make it run any faster? Is there a downside?
VBA Code:
Sub TestOpen()
SearchEdit.Show
SearchEdit.SE_MS_select.Visible = False
SearchEdit.MS_warning.Visible = False
SearchEdit.SE_ModelIndication.Visible = False
SearchEdit.SE_DatePending.Visible = False
SearchEdit.SE_DateConfirmed.Visible = False
SearchEdit.SE_DateUnConfirmed.Visible = False
SearchEdit.SE_Confirm.Visible = False
SearchEdit.SE_Unconfirm.Visible = False
SearchEdit.cmdNotPending.Visible = False
SearchEdit.SE_Notes_11.Value = Sheets("Calendar").Range("FA" & ActiveCell.Row).Value
End Sub
VBA Code:
Sub TestOpen2()
With SearchEdit
.Show
.SE_MS_select.Visible = False
.MS_warning.Visible = False
.SE_ModelIndication.Visible = False
.SE_DatePending.Visible = False
.SE_DateConfirmed.Visible = False
.SE_DateUnConfirmed.Visible = False
.SE_Confirm.Visible = False
.SE_Unconfirm.Visible = False
.cmdNotPending.Visible = False
End With
End Sub
Also related, I've noticed that this code works:
VBA Code:
SearchEdit.SE_Notes_11.Value = Sheets("Calendar").Range("FA" & ActiveCell.Row).Value
...and so does this:
VBA Code:
SE_Notes_11 = Sheets("Calendar").Range("FA" & ActiveCell.Row)
The second example is "cleaner," but is it any more efficient (speed-wise)?