Hello everyone. New VBA user here and in need of some help. I have a workbook with two sheets, “Max Data” and “Min Data”. Both sheets have the same number of columns with data in columns A and B being the same. Columns C and on have unique values.
<tbody>
</tbody>
<tbody>
</tbody>
I have a macro that will clear contents on the “Max Data” sheet based on certain criteria. The result will look something like this:
<tbody>
</tbody>
<tbody>
</tbody>
What I need is a macro that compares the values in Column B of both sheets and clears contents from the “Min Data” sheet if it’s not found on the “Min Data” sheet. Looking at the images above the value in B7 on the “Min Data” sheet is not found in column B on the “Max Data” sheet. I need to clear the contents from the “Min Data” sheet also. The calculations in the last row of both sheets is used elsewhere hence the need to clear contents rather than delete the entire row.
Any help would be greatly appreciated!
Edit: Reading this after posting it looks really confusing. Sorry about that.
Part Number | Serial Number | Data | Data |
1 | XXXX-1 | XXX | XXX |
2 | XXXX-2 | XXX | XXX |
3 | XXXX-3 | XXX | XXX |
4 | XXXX-4 | XXX | XXX |
5 | XXXX-5 | XXX | XXX |
<tbody>
</tbody>
Part Number | Serial Number | Data | Data |
1 | XXXX-1 | XXX | XXX |
2 | XXXX-2 | XXX | XXX |
3 | XXXX-3 | XXX | XXX |
4 | XXXX-4 | XXX | XXX |
5 | XXXX-5 | XXX | XXX |
<tbody>
</tbody>
I have a macro that will clear contents on the “Max Data” sheet based on certain criteria. The result will look something like this:
Part Number | Serial Number | Data | Data |
1 | XXXX-1 | XXX | XXX |
2 | XXXX-3 | XXX | XXX |
3 | XXXX-5 | XXX | XXX |
4 | |||
5 |
<tbody>
</tbody>
Part Number | Serial Number | Data | Data |
1 | XXXX-1 | XXX | XXX |
2 | XXXX-2 | XXX | XXX |
3 | XXXX-3 | XXX | XXX |
4 | XXXX-4 | XXX | XXX |
5 | XXXX-5 | XXX | XXX |
<tbody>
</tbody>
What I need is a macro that compares the values in Column B of both sheets and clears contents from the “Min Data” sheet if it’s not found on the “Min Data” sheet. Looking at the images above the value in B7 on the “Min Data” sheet is not found in column B on the “Max Data” sheet. I need to clear the contents from the “Min Data” sheet also. The calculations in the last row of both sheets is used elsewhere hence the need to clear contents rather than delete the entire row.
Any help would be greatly appreciated!
Edit: Reading this after posting it looks really confusing. Sorry about that.