Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default Make a cell mandatory before sending

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11
Default Make a cell mandatory before sending

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default Make a cell mandatory before sending

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default Make a cell mandatory before sending

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11
Default Make a cell mandatory before sending

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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
How do I make a specific cell mandatory? soday Excel Discussion (Misc queries) 2 April 30th 09 04:41 PM
how to make a cell mandatory in the excel sheet Asif[_2_] Excel Worksheet Functions 2 July 29th 08 01:59 PM
How can I make a cell mandatory? [email protected] Excel Discussion (Misc queries) 3 February 6th 06 11:01 PM
How can I make a cell mandatory and only accept a Y or N? Vicki Excel Worksheet Functions 1 June 23rd 05 07:23 PM
Can I make cell completion mandatory in excel? Peter Green Excel Discussion (Misc queries) 3 December 23rd 04 03:29 PM


All times are GMT +1. The time now is 06:57 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"