alienscript
07-29-2007, 10:21 AM
Hi VB gurus,
In my sample worksheet I have done long formulas and packaged the task in a macro. My problem is I dont know how to code in order to check for specific range of cells for the content before my macro is allowed to take off. I like the macro to firstly check that if the following cells text in row 1 are not matched, use MsgBox to display the wrong versus correct cells string text, then vbOK to exit macro. Also, if Range("B2:G2","J2") are completely blank, use MsgBox to display "missing data", then vbOK to exit macro.
cell B =PurR
cell C =STL
cell D =CS
cell E =PO
cell F =SO
cell G =IB
cell L =Unit Cost
If these cell texts (Upper or Lower case) are in their specific cells, macro will proceed.
If either one or some of these cell texts are not matched, display MsgBox of the wrong and correct cell texts. Then stop macro.
If Range("B2:G2","J2") are completely blank, MsgBox to display "missing data", Then stop macro.
This is the missing piece of code i need to complete the whole work task. Appreciate very much if VB experts can help me with this last piece of code. Thousands Thanks in advance :)
In my sample worksheet I have done long formulas and packaged the task in a macro. My problem is I dont know how to code in order to check for specific range of cells for the content before my macro is allowed to take off. I like the macro to firstly check that if the following cells text in row 1 are not matched, use MsgBox to display the wrong versus correct cells string text, then vbOK to exit macro. Also, if Range("B2:G2","J2") are completely blank, use MsgBox to display "missing data", then vbOK to exit macro.
cell B =PurR
cell C =STL
cell D =CS
cell E =PO
cell F =SO
cell G =IB
cell L =Unit Cost
If these cell texts (Upper or Lower case) are in their specific cells, macro will proceed.
If either one or some of these cell texts are not matched, display MsgBox of the wrong and correct cell texts. Then stop macro.
If Range("B2:G2","J2") are completely blank, MsgBox to display "missing data", Then stop macro.
This is the missing piece of code i need to complete the whole work task. Appreciate very much if VB experts can help me with this last piece of code. Thousands Thanks in advance :)