RAJESH1960
Banned for repeated rules violations
- Joined
- Mar 26, 2020
- Messages
- 2,313
- Office Version
- 2019
- Platform
- Windows
Hello code experts
I am trying to check the whether the headings in the pasteData sheet are matching with the CopyData sheet with Msg boxes. If they are matched, then the code has to run the rest of the code. If they are not matched then it has to exit sub.
First the code has to check for only one heading “Supplier Invoice No. & Date” the most wanted heading required in the paste data sheet. If it is not available, then the code should display a msg box that the “Supplier Invoice No. & Date” is missing with a single button Ok and if I press Ok, I should be able to exit the Sub. So that I can correct the Paste data sheet and run the code again. If it is available, then continue with the next line to check the other headings which are not matching.
After inserting the “Supplier Invoice No. & Date” column, when again I run the code, it should check if there are headings in the paste data which are not in the copy data sheet, it will display a Msg box a message =The name of the headings not available + “not in the database” . Here again if there are mismatches and I press cancel, the code should exit the sub else run the rest of the code i.e., to clear the data and display msg box “All data cleared.”
The problem is in both the cases, the code is running the rest of the code and clearing the data, even after pressing cancel.
Need your expertise to solve this issue.
MisMatch Headings exit sub.xlsm
I am trying to check the whether the headings in the pasteData sheet are matching with the CopyData sheet with Msg boxes. If they are matched, then the code has to run the rest of the code. If they are not matched then it has to exit sub.
First the code has to check for only one heading “Supplier Invoice No. & Date” the most wanted heading required in the paste data sheet. If it is not available, then the code should display a msg box that the “Supplier Invoice No. & Date” is missing with a single button Ok and if I press Ok, I should be able to exit the Sub. So that I can correct the Paste data sheet and run the code again. If it is available, then continue with the next line to check the other headings which are not matching.
After inserting the “Supplier Invoice No. & Date” column, when again I run the code, it should check if there are headings in the paste data which are not in the copy data sheet, it will display a Msg box a message =The name of the headings not available + “not in the database” . Here again if there are mismatches and I press cancel, the code should exit the sub else run the rest of the code i.e., to clear the data and display msg box “All data cleared.”
The problem is in both the cases, the code is running the rest of the code and clearing the data, even after pressing cancel.
Need your expertise to solve this issue.
MisMatch Headings exit sub.xlsm