I am trying to determine if any one of the strings inside any one of the array items in a VBA dictionary equal a string of 4 spaces.
If _ Not CStr(info.Items(1, 4)) = " " Or _ Not CStr(info.Items(1, 5)) = " " Or _ Not CStr(info.Items(1, 6)) = " " Or _ Not CStr(info.Items(2, 4)) = " " Or _ Not CStr(info.Items(2, 5)) = " " Or _ Not CStr(info.Items(2, 6)) = " " Or _ Not CStr(info.Items(3, 4)) = " " Or _ Not CStr(info.Items(3, 5)) = " " Or _ Not CStr(info.Items(3, 6)) = " " Or _ Not CStr(info.Items(4, 4)) = " " Or _ Not CStr(info.Items(4, 5)) = " " Or _ Not CStr(info.Items(4, 6)) = " " Then I keep getting a Subscript out of range error. I've tried
...info.Items(1)(4)... as well with the same error.
I know each array item has 6 elements in it, and I know there are 4 keys in the dictionary. How do I access elements of each key's item if the item is an array?
Dim RQItems As Dictionary Dim RPItems As Dictionary Dim IMPItems As Dictionary Dim EMItems As Dictionary Dim BOOTItems As Dictionary Dim RQ1(6) As String Dim RQ2(6) As String Dim RQ3(6) As String Dim RQ4(6) As String Set RQItems = New Dictionary RQ1(1) = "PSA " RQ1(2) = "Prlm" RQ1(3) = "Info" RQ1(4) = " " RQ1(5) = " " RQ1(6) = " " RQ2(1) = "Mary" RQ2(2) = "Clnt" RQ2(3) = "Escr" RQ2(4) = "Bank" RQ2(5) = " SS " RQ2(6) = " " RQ3(1) = "Inst" RQ3(2) = "Wire" RQ3(3) = " " RQ3(4) = " " RQ3(5) = " " RQ3(6) = " " RQ4(1) = "Acct" RQ4(2) = "Fee " RQ4(3) = " " RQ4(4) = " " RQ4(5) = " " RQ4(6) = " " RQItems("OPEN") = RQ1 RQItems("DOCS") = RQ2 RQItems("$$$$") = RQ3 RQItems("FILE") = RQ4 I pass these into a function like myFn(info As Dictionary)