없으면 빌려쓰는 ArrayList

nØthing specia¡|2019년 6월 25일
Posts

없으면 빌려쓰는 ArrayList

nØthing specia¡|2019년 6월 25일

VBA에는 남다른 철학이 있다. '없으면 빌어다 써라~'. 그런데 '한 푼 줍쑈~'라도 하려면 뭔가 있어야 하는데, 그것이 CreateObject()함수이다. CreateObject()함수를 사용하여 닷넷의 ArrayList를 빌어다 쓸 수 있는데, 다음은 ArrayList를 이용한 정렬이다. Sub demoArrayList() Dim it With CreateObject("System.Collections.ArrayList") For Each it In Array("aa1", "aa2", "aa3", "aa3", "aa2", "aa6") .Add it: Next '// 오름차순 .Sort