Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I have an excel form that is used to complete and inspection and then sent to
a particular person. I have a macro that they use for the SendMail function. They are suppose to complete the Name & Phone number field but this does not always get done. I want to make these cells mandatory before they are allowed to email the form. Can someone tell me where to get the code? I know very little VB code so please try to be very specific. Thank you, dmposey |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Perhaps something like this:
If Cells(1,"A") = "" then Response = msgbox("Please insert value in cell A1") Else SendMail code End If "dmposey" wrote in message ... I have an excel form that is used to complete and inspection and then sent to a particular person. I have a macro that they use for the SendMail function. They are suppose to complete the Name & Phone number field but this does not always get done. I want to make these cells mandatory before they are allowed to email the form. Can someone tell me where to get the code? I know very little VB code so please try to be very specific. Thank you, dmposey |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Thanks Slick Willie. I'll try it in the morning and let you know how it works!
"Slick Willie" wrote: Perhaps something like this: If Cells(1,"A") = "" then Response = msgbox("Please insert value in cell A1") Else SendMail code End If "dmposey" wrote in message ... I have an excel form that is used to complete and inspection and then sent to a particular person. I have a macro that they use for the SendMail function. They are suppose to complete the Name & Phone number field but this does not always get done. I want to make these cells mandatory before they are allowed to email the form. Can someone tell me where to get the code? I know very little VB code so please try to be very specific. Thank you, dmposey |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I'm sure this is very simple, but I'm having problems with this code. I told
you I was a beginner! The form that I have created has 4 mandatory cells that need to be completed. For each cell that is omitted, I want to display a msgbox. Ex: Cell A2 requires their name. If cell A2 is "" then msgbox "Please enter your name before submitting" else SendMail. Cell A5 requires Phone Number: If cell A5 is "" then msgbox "Please enter Phone Number before submitting" else SendMail. What am I doing wrong? here is what I have coded to a button: Sub Button1_Click() dim cells If cells(2, a) = "" Then MsgBox ("Please insert value in cell A2") Else ActiveWorkbook.SendMail Recipients:="" End If End Sub "dmposey" wrote: Thanks Slick Willie. I'll try it in the morning and let you know how it works! "Slick Willie" wrote: Perhaps something like this: If Cells(1,"A") = "" then Response = msgbox("Please insert value in cell A1") Else SendMail code End If "dmposey" wrote in message ... I have an excel form that is used to complete and inspection and then sent to a particular person. I have a macro that they use for the SendMail function. They are suppose to complete the Name & Phone number field but this does not always get done. I want to make these cells mandatory before they are allowed to email the form. Can someone tell me where to get the code? I know very little VB code so please try to be very specific. Thank you, dmposey |
#5
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Certain words cannot be used as variables because they have special
meaning to Excel. Cells is one of those words, you shouldn't have to declare it as a variable. "dmposey" wrote in message ... I'm sure this is very simple, but I'm having problems with this code. I told you I was a beginner! The form that I have created has 4 mandatory cells that need to be completed. For each cell that is omitted, I want to display a msgbox. Ex: Cell A2 requires their name. If cell A2 is "" then msgbox "Please enter your name before submitting" else SendMail. Cell A5 requires Phone Number: If cell A5 is "" then msgbox "Please enter Phone Number before submitting" else SendMail. What am I doing wrong? here is what I have coded to a button: Sub Button1_Click() dim cells If cells(2, a) = "" Then MsgBox ("Please insert value in cell A2") Else ActiveWorkbook.SendMail Recipients:="" End If End Sub |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
How do I make a specific cell mandatory? | Excel Discussion (Misc queries) | |||
how to make a cell mandatory in the excel sheet | Excel Worksheet Functions | |||
How can I make a cell mandatory? | Excel Discussion (Misc queries) | |||
How can I make a cell mandatory and only accept a Y or N? | Excel Worksheet Functions | |||
Can I make cell completion mandatory in excel? | Excel Discussion (Misc queries) |