Hi Folks,
I'm trying to insert a code into my file that performs a check for empty cells.
The idea is that this macro should check Cells C3:C16 C19:C21 if any of them is empty and return an error if that's the case.
This macro is assigned to a Button1 that displays text 'send request'
I tried a macro that simply hid the button until all cells are filled but it was too confusing for the users.
I'm struggling on how to add the Call MsgBox if range is blank/empty
Hope this makes sense :v
Thank you all in advance,
Mehow.
I'm trying to insert a code into my file that performs a check for empty cells.
The idea is that this macro should check Cells C3:C16 C19:C21 if any of them is empty and return an error if that's the case.
This macro is assigned to a Button1 that displays text 'send request'
I tried a macro that simply hid the button until all cells are filled but it was too confusing for the users.
VBA Code:
Sub Email_CurrentWorkBook()
Dim OlApp As Object
Dim NewMail As Object
Set OlApp = CreateObject("Outlook.Application")
Set NewMail = OlApp.CreateItem(0)
On Error Resume Next
With NewMail
.to = "xx"
.CC = ""
.BCC = ""
.Subject = "xx"
.HTMLBody = "<HTML><BODY>xx</BODY></HTML>"
.Attachments.Add ActiveWorkbook.FullName
.display ' .display only - this must be manually checked before sending
End With
On Error GoTo 0
Set NewMail = Nothing
Set OlApp = Nothing
End Sub
I'm struggling on how to add the Call MsgBox if range is blank/empty
Hope this makes sense :v
Thank you all in advance,
Mehow.