Hi All,
I have a large data set in sheet1 which has ~20 columns and 10000+rows and each row has a set of limits based on what value is in column B this data set changes ~once per week.
The limits are stored in sheet2 where column A contains the unique list of values from column B in sheet1 and the min and max limits are stored over ~40 rows to the right of the value.
Easiest way I can think to explain is below example I have searched a lot and can't come up with the answer but I am currently doing this with index match then a formula to check if it is within the limits but it takes an age to load so i wish to do this with vba so i can update it as and when and if I need to leave it to run for a bit I can; but the sheet would then be usable and quick afterwards.
example sheet 1:
[TABLE="width: 500"]
<tbody>[TR]
[TD]header 1[/TD]
[TD]header 2[/TD]
[TD]header 3[/TD]
[TD]header 4[/TD]
[/TR]
[TR]
[TD]random value1[/TD]
[TD]A[/TD]
[TD]1[/TD]
[TD]2[/TD]
[/TR]
[TR]
[TD]random value2[/TD]
[TD]B[/TD]
[TD]4[/TD]
[TD]2[/TD]
[/TR]
[TR]
[TD]random value3[/TD]
[TD]A[/TD]
[TD]6[/TD]
[TD]3[/TD]
[/TR]
</tbody>[/TABLE]
example sheet 2:
[TABLE="width: 500"]
<tbody>[TR]
[TD]sheet 1 header 2 value[/TD]
[TD]min limit for header 3 sheet 1[/TD]
[TD]max limit for header 3 sheet 1[/TD]
[TD]min limit for header 4 sheet 1[/TD]
[TD]max limit for header 4 sheet 1[/TD]
[/TR]
[TR]
[TD]A[/TD]
[TD]3[/TD]
[TD]9[/TD]
[TD]1[/TD]
[TD]4[/TD]
[/TR]
[TR]
[TD]B[/TD]
[TD]3[/TD]
[TD]7[/TD]
[TD]5[/TD]
[TD]8[/TD]
[/TR]
</tbody>[/TABLE]
result:
[TABLE="width: 500"]
<tbody>[TR]
[TD]header 1[/TD]
[TD]header 2[/TD]
[TD]header 3[/TD]
[TD]header 4[/TD]
[TD]min limit for header 3 sheet 1[/TD]
[TD]max limit for header 3 sheet 1[/TD]
[TD]min limit for header 4 sheet 1[/TD]
[TD]max limit for header 4 sheet 1[/TD]
[TD]within limits header 3[/TD]
[TD]within limits header 4[/TD]
[TD]within limits overall[/TD]
[/TR]
[TR]
[TD]random value1[/TD]
[TD]A[/TD]
[TD]1[/TD]
[TD]2[/TD]
[TD]3[/TD]
[TD]9[/TD]
[TD]1[/TD]
[TD]4[/TD]
[TD]no[/TD]
[TD]yes[/TD]
[TD]fail[/TD]
[/TR]
[TR]
[TD]random value2[/TD]
[TD]B[/TD]
[TD]4[/TD]
[TD]2[/TD]
[TD]3[/TD]
[TD]7[/TD]
[TD]5[/TD]
[TD]8[/TD]
[TD]yes[/TD]
[TD]no[/TD]
[TD]fail[/TD]
[/TR]
[TR]
[TD]random value3[/TD]
[TD]A[/TD]
[TD]6[/TD]
[TD]3[/TD]
[TD]3[/TD]
[TD]9[/TD]
[TD]1[/TD]
[TD]4[/TD]
[TD]yes[/TD]
[TD]yes[/TD]
[TD]pass[/TD]
[/TR]
</tbody>[/TABLE]
I hope this makes sense as this problem is driving me crazy as it takes me a long time to do anything with the data as I have to review the data on an almost daily basis.
Thanks in advance to any help I can get as I am fairly new to vba but I'm sure this is where the answer lies.
Regards,
Matt
I have a large data set in sheet1 which has ~20 columns and 10000+rows and each row has a set of limits based on what value is in column B this data set changes ~once per week.
The limits are stored in sheet2 where column A contains the unique list of values from column B in sheet1 and the min and max limits are stored over ~40 rows to the right of the value.
Easiest way I can think to explain is below example I have searched a lot and can't come up with the answer but I am currently doing this with index match then a formula to check if it is within the limits but it takes an age to load so i wish to do this with vba so i can update it as and when and if I need to leave it to run for a bit I can; but the sheet would then be usable and quick afterwards.
example sheet 1:
[TABLE="width: 500"]
<tbody>[TR]
[TD]header 1[/TD]
[TD]header 2[/TD]
[TD]header 3[/TD]
[TD]header 4[/TD]
[/TR]
[TR]
[TD]random value1[/TD]
[TD]A[/TD]
[TD]1[/TD]
[TD]2[/TD]
[/TR]
[TR]
[TD]random value2[/TD]
[TD]B[/TD]
[TD]4[/TD]
[TD]2[/TD]
[/TR]
[TR]
[TD]random value3[/TD]
[TD]A[/TD]
[TD]6[/TD]
[TD]3[/TD]
[/TR]
</tbody>[/TABLE]
example sheet 2:
[TABLE="width: 500"]
<tbody>[TR]
[TD]sheet 1 header 2 value[/TD]
[TD]min limit for header 3 sheet 1[/TD]
[TD]max limit for header 3 sheet 1[/TD]
[TD]min limit for header 4 sheet 1[/TD]
[TD]max limit for header 4 sheet 1[/TD]
[/TR]
[TR]
[TD]A[/TD]
[TD]3[/TD]
[TD]9[/TD]
[TD]1[/TD]
[TD]4[/TD]
[/TR]
[TR]
[TD]B[/TD]
[TD]3[/TD]
[TD]7[/TD]
[TD]5[/TD]
[TD]8[/TD]
[/TR]
</tbody>[/TABLE]
result:
[TABLE="width: 500"]
<tbody>[TR]
[TD]header 1[/TD]
[TD]header 2[/TD]
[TD]header 3[/TD]
[TD]header 4[/TD]
[TD]min limit for header 3 sheet 1[/TD]
[TD]max limit for header 3 sheet 1[/TD]
[TD]min limit for header 4 sheet 1[/TD]
[TD]max limit for header 4 sheet 1[/TD]
[TD]within limits header 3[/TD]
[TD]within limits header 4[/TD]
[TD]within limits overall[/TD]
[/TR]
[TR]
[TD]random value1[/TD]
[TD]A[/TD]
[TD]1[/TD]
[TD]2[/TD]
[TD]3[/TD]
[TD]9[/TD]
[TD]1[/TD]
[TD]4[/TD]
[TD]no[/TD]
[TD]yes[/TD]
[TD]fail[/TD]
[/TR]
[TR]
[TD]random value2[/TD]
[TD]B[/TD]
[TD]4[/TD]
[TD]2[/TD]
[TD]3[/TD]
[TD]7[/TD]
[TD]5[/TD]
[TD]8[/TD]
[TD]yes[/TD]
[TD]no[/TD]
[TD]fail[/TD]
[/TR]
[TR]
[TD]random value3[/TD]
[TD]A[/TD]
[TD]6[/TD]
[TD]3[/TD]
[TD]3[/TD]
[TD]9[/TD]
[TD]1[/TD]
[TD]4[/TD]
[TD]yes[/TD]
[TD]yes[/TD]
[TD]pass[/TD]
[/TR]
</tbody>[/TABLE]
I hope this makes sense as this problem is driving me crazy as it takes me a long time to do anything with the data as I have to review the data on an almost daily basis.
Thanks in advance to any help I can get as I am fairly new to vba but I'm sure this is where the answer lies.
Regards,
Matt