lezawang
Well-known Member
- Joined
- Mar 27, 2016
- Messages
- 1,805
- Office Version
- 2016
- Platform
- Windows
Hi
What is the idea behind using "With"? Is it to save time. I am reading this code
'Fill CityListBox
With CityListBox
.AddItem "San Francisco"
.AddItem "Oakland"
.AddItem "Richmond"
End With
+++++
I am thinking, this is the same as
CityListBox.AddItem = "San Francisco"
CityListBox.AddItem = "Oakland"
CityListBox.AddItem = "Richmond"
Am I right?
ps: the full code is here https://www.excel-easy.com/vba/userform.html
Thanks
What is the idea behind using "With"? Is it to save time. I am reading this code
'Fill CityListBox
With CityListBox
.AddItem "San Francisco"
.AddItem "Oakland"
.AddItem "Richmond"
End With
+++++
I am thinking, this is the same as
CityListBox.AddItem = "San Francisco"
CityListBox.AddItem = "Oakland"
CityListBox.AddItem = "Richmond"
Am I right?
ps: the full code is here https://www.excel-easy.com/vba/userform.html
Thanks