Hi all
I get the impression that the use of brackets [such as this] in VBA code is shorthand to produce the same compiled effect as an alternative more verbose (but possibly to me easier to understand) coding.
Example
Could someone please re-write the above code without using the bracketed syntax, just so that I can understand the effect of that syntax?Code:Private Sub UserForm_Initialize() Me.ComboBox1.List = [MyArray] End Sub
Thanks
Last edited by 1eyedjack; 02-22-2010 at 04:53 PM.
The brackets are a shortcut to the VBA Evaluate function. They look nice and compact, but when Evaluate is not needed, just add a function where none is necessary.
Code:Me.ComboBox1.List = Range("MyArray").Value
Microsoft MVP - Excel
Entia non sunt multiplicanda sine necessitate
Thanks - just what I needed to know
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks