odkvm.blogg.se

Vba collection of integers
Vba collection of integers






Set IntersectRslt = CollIntersect(ColA, ColB)

vba collection of integers

UnionRslt As Collection, IntersectRslt As CollectionĪddItem ColA, "10": addItem ColA, "20": addItem ColA, "30"ĪddItem ColB, "10": addItem ColB, "30": addItem ColB, "40"

vba collection of integers

If X Is Nothing Then Set X = New Collectionįunction CollUnion(A As Collection, B As Collection) As Collectionįunction CollIntersect(A As Collection, B As Collection) As Collectionįunction SetIsIn(X As Collection, ItemVal) As Booleanĭim ColA As Collection, ColB As Collection, _

vba collection of integers

Code: Sub TestMacroConst FirstHouse As Long = 1, SecondHouse As Long = 2, ThirdHouse As Long = 4, FourthHouse As Long = 8, FifthHouse As Long = 16Const SixthHouse As Long = 32Const SeventhHouse As Long = 64, EighthHouse As Long = 128, NinthHouse As Long = 256, TenthHouse As Long = 512, EleventhHouse As Long = 1024Const TwelfthHouse As Long = 2048Const Kendras As Long = FirstHouse Or FourthHouse Or SeventhHouse Or TenthHouse'value of Kendras is 585, and I could have used the + operator, but we ARE setting this up for Boolean operations, so.Debug.Print 'The sixth house is a member of Kendras? ' & ((SixthHouse And Kendras) 0)Debug.Print 'The fourth house is a member of Kendras? ' & ((FourthHouse And Kendras) 0)End SubThe code sample is intended for a Hindu Astrology program, the idea is to computer a person's chart, and then run a series of conditional tests for various combinations of planets in houses, planets in signs, etc.Kendras is a collective term for the first, fourth, seventh, and tenth houses.The OR operation creates a set, or a union of sets.The AND operation tests for the intersection of sets.Don't scrimp on parantheses the code will crash.Sub addItem(ByRef X As Collection, Item As String)








Vba collection of integers