Hoping a smarter mind than mine can help out<o></o>
In my spreadsheet I have a dropdown list (Cell I12) with 2options: “Deliver to:” and “Collection”.<o></o>
I would like a VB Code to validate/verify a number of conditions/criteriabefore allowing an email order to be sent. <o></o>
The conditions/criteria that need to be met before allowingan email to be sent are:<o></o>
1) The (Dropbox) option: “Deliver to:” chosen and the address fields below (CellsI13:I17) are filled in.
Or if:
2) The (Dropbox) option: “Collection” chosen and the address fields below (Cells I13:I17) are not filled in / empty.<o></o>
Otherwise - the code should NOT allow an email to besent and exit the sub with a MsgBox -something like.[“Complete address fields”]. It would be great if the cursor goesback to the first blank/empty cell (but not important).<o></o>
I’m using the code below with varying results but haven’t beenable to get what I’m really after as. Unfortunately I’m still picking up VBA. Any help asusual is appreciated.
code:
Sub Emailit()<o></o>
IfRange("N13").Value = "" Then<o></o>
MsgBox "You havenot added a date"<o></o>
Exit Sub<o></o>
End If<o></o>
IfRange("G19").Value = "" Or Range("H19").Value ="" Or Range("I19").Value = "" Then<o></o>
MsgBox "Have youhave not added your order"<o></o>
Exit Sub<o></o>
End If<o></o>
Application.Dialogs(xlDialogSendMail).Show"someone@somewhere.com"<o></o>
Clear_Order<o></o>
End Sub<o></o>
Many thanks in advance <o></o>
In my spreadsheet I have a dropdown list (Cell I12) with 2options: “Deliver to:” and “Collection”.<o></o>
I would like a VB Code to validate/verify a number of conditions/criteriabefore allowing an email order to be sent. <o></o>
The conditions/criteria that need to be met before allowingan email to be sent are:<o></o>
1) The (Dropbox) option: “Deliver to:” chosen and the address fields below (CellsI13:I17) are filled in.
Or if:
2) The (Dropbox) option: “Collection” chosen and the address fields below (Cells I13:I17) are not filled in / empty.<o></o>
Otherwise - the code should NOT allow an email to besent and exit the sub with a MsgBox -something like.[“Complete address fields”]. It would be great if the cursor goesback to the first blank/empty cell (but not important).<o></o>
I’m using the code below with varying results but haven’t beenable to get what I’m really after as. Unfortunately I’m still picking up VBA. Any help asusual is appreciated.
code:
Sub Emailit()<o></o>
IfRange("N13").Value = "" Then<o></o>
MsgBox "You havenot added a date"<o></o>
Exit Sub<o></o>
End If<o></o>
IfRange("G19").Value = "" Or Range("H19").Value ="" Or Range("I19").Value = "" Then<o></o>
MsgBox "Have youhave not added your order"<o></o>
Exit Sub<o></o>
End If<o></o>
Application.Dialogs(xlDialogSendMail).Show"someone@somewhere.com"<o></o>
Clear_Order<o></o>
End Sub<o></o>
Many thanks in advance <o></o>