How do you evaluate cell value in vba

  • Thread starter Thread starter Umgal21
  • Start date Start date
U

Umgal21

I am trying to use a button to send a workbook on a condition of cell
F7 having the value of 15 or more. If the value is less than 15, a
msgbox displays telling the user to populate all fields in order for
them to send. If the value equals 15 or more, an e-mail window opens
with the workbook attached. Currently, everytime i click the submit
button, it gives me the msgbox and does nothing else regardless of what
value is in F7.

Here's the code I have written so far:
===========================================
Private Sub Send_Click()

If ( F7 < 15 ) Then
MsgBox ("You must populate all required fields to send.")
Else
ActiveWorkbook.SendMail Recipients:=MailTo
End If



End Sub
===========================================
Suggestions please?
 
If Range("F7").Value < 15 Then

--
Jim
|I am trying to use a button to send a workbook on a condition of cell
| F7 having the value of 15 or more. If the value is less than 15, a
| msgbox displays telling the user to populate all fields in order for
| them to send. If the value equals 15 or more, an e-mail window opens
| with the workbook attached. Currently, everytime i click the submit
| button, it gives me the msgbox and does nothing else regardless of what
| value is in F7.
|
| Here's the code I have written so far:
| ===========================================
| Private Sub Send_Click()
|
| If ( F7 < 15 ) Then
| MsgBox ("You must populate all required fields to send.")
| Else
| ActiveWorkbook.SendMail Recipients:=MailTo
| End If
|
|
|
| End Sub
| ===========================================
| Suggestions please?
|
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top