Hi all,
I'm pretty green with vba and have spent some time trying to find a solution prior to posting here.
I have to 2 ( 2d) arrays( LiteArr and PlatArr) and would like to loop through the first dimension of the LiteArr and find a match in the first dimension of PlatArr. ( there is no possibility of a non match) Once match is found:
Test if the 1st element( value) of 2nd dimension of LiteArr is < 1st element( value) of 2nd dimension of PlatArr . (If true msgbox and exit sub) else ' minimum width
Continue loop : Test if the 2nd element( value) of 2nd dimension of LiteArr is > 2nd element( value) of 2nd dimension of PlatArr (If true msgbox and exit sub) else ' maximum width
Loop continues comparing remaining 3 elements for 3rd to 5th of both arrays
There is lots of examples of reading arrays back to a worksheet but i couldn't find anything comparing 2 arrays using offsets or lookups for 2 arrays.
All help would be greatly appreciated ... i tend to understand things better once I see the code and can use the watch /immediate windows to see what is happening .
Below is the code to populate arrays - i haven't attempted to write nested loop as i am unsure of how to code it
I'm pretty green with vba and have spent some time trying to find a solution prior to posting here.
I have to 2 ( 2d) arrays( LiteArr and PlatArr) and would like to loop through the first dimension of the LiteArr and find a match in the first dimension of PlatArr. ( there is no possibility of a non match) Once match is found:
Test if the 1st element( value) of 2nd dimension of LiteArr is < 1st element( value) of 2nd dimension of PlatArr . (If true msgbox and exit sub) else ' minimum width
Continue loop : Test if the 2nd element( value) of 2nd dimension of LiteArr is > 2nd element( value) of 2nd dimension of PlatArr (If true msgbox and exit sub) else ' maximum width
Loop continues comparing remaining 3 elements for 3rd to 5th of both arrays
There is lots of examples of reading arrays back to a worksheet but i couldn't find anything comparing 2 arrays using offsets or lookups for 2 arrays.
All help would be greatly appreciated ... i tend to understand things better once I see the code and can use the watch /immediate windows to see what is happening .
Below is the code to populate arrays - i haven't attempted to write nested loop as i am unsure of how to code it
VBA Code:
Dim LiteArr() As Variant
Sheet6.Activate
LiteArr = Range("A2", Range("A2").End(xlDown).End(xlToRight))
'Erase LiteArr
Dim PlatArr() As Variant
Sheet4.Activate
PlatArr = Range("BG3:BL24")