In Distress
New Member
- Joined
- Mar 12, 2003
- Messages
- 37
Morning all (or afternoon, depending on where in the world you are)
I have a completely ignorant and probably basic problem that I desperately need answering.
Okay the story thus far is this. I have a public string variable called (PVS_TheSelectedLGAIs) that is set by another procedure in my VBA Project.
In another procedure I have created a 4 dimensional array (4 columns of data), that I set using the following:
Dim SearchArray() as variant
SearchArray = Range((FirstRowAddress),(LastRowAddress))
The Variables (FirstRowAddress) & (LastRowAddress)) are used earlier in my procedure to determine the range that I want use in my array. I believe this is the equivalent of Range("A1:D11350") - or there abouts.
Now, what I want to do is search for a value in column 1 of the newly created array. The value I want to try and find is the value in the (PVS_TheSelectedLGAIs) variable that I mentioned before. If it finds the value in the array, there are several things I want to do with it, but for now I just want to display the text "found value" in a message box, but if it doesn't find it, I want to display the text "Didn't find it" in a message box.
I can't for the life of me figure out how to do this.
I'm ashamed and should bow my head in shame for not knowing this, but I'm new to arrays in VBA, and as you can see I'm struggling.
Thanks in advance all. You'll be saving the few remaining hairs on my head that I have left.
I have a completely ignorant and probably basic problem that I desperately need answering.
Okay the story thus far is this. I have a public string variable called (PVS_TheSelectedLGAIs) that is set by another procedure in my VBA Project.
In another procedure I have created a 4 dimensional array (4 columns of data), that I set using the following:
Dim SearchArray() as variant
SearchArray = Range((FirstRowAddress),(LastRowAddress))
The Variables (FirstRowAddress) & (LastRowAddress)) are used earlier in my procedure to determine the range that I want use in my array. I believe this is the equivalent of Range("A1:D11350") - or there abouts.
Now, what I want to do is search for a value in column 1 of the newly created array. The value I want to try and find is the value in the (PVS_TheSelectedLGAIs) variable that I mentioned before. If it finds the value in the array, there are several things I want to do with it, but for now I just want to display the text "found value" in a message box, but if it doesn't find it, I want to display the text "Didn't find it" in a message box.
I can't for the life of me figure out how to do this.
I'm ashamed and should bow my head in shame for not knowing this, but I'm new to arrays in VBA, and as you can see I'm struggling.
Thanks in advance all. You'll be saving the few remaining hairs on my head that I have left.