IsBlank function run on form will not allow initial save of bank value to send to users

LeslyeE

New Member
Joined
Jun 17, 2014
Messages
20
I am having an issue with a similar request. I need to send my excel sheet to the user with blank cells to be filled in. Once the user opens this book I need to prevent the user from being able to save the workbook without the specified cells filled in. (This portion I have code that works for it) I can not figure out how to send the code to the user blank.

Code:
 Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As Boolean)
If IsEmpty(ThisWorkbook.Sheets(1).Range("B6")) Then
        MsgBox ("Must enter Supplier Name")
        Cancel = True
    Else
    If IsEmpty(ThisWorkbook.Sheets(1).Range("C6")) Then
       MsgBox ("Must enter Supplier Location")
       Cancel = True
    Else
    If IsEmpty(ThisWorkbook.Sheets(1).Range("D6")) Then
       MsgBox ("Please enter your 5 digit supplier code. If you need assistance with the supplier code please contact SSG at 1(800)782-8099")
       Cancel = True
    Else
    If IsEmpty(ThisWorkbook.Sheets(1).Range("B10")) Then
       MsgBox ("Please enter expected users First name")
       Cancel = True
    Else
    If IsEmpty(ThisWorkbook.Sheets(1).Range("C10")) Then
       MsgBox ("Please enter expected users Last name")
       Cancel = True
    Else
    If IsEmpty(ThisWorkbook.Sheets(1).Range("D10")) Then
       MsgBox ("Please Create an original SSO # for this user")
       Cancel = True
    Else
    If IsEmpty(ThisWorkbook.Sheets(1).Range("F10")) Then
       MsgBox ("Please enter expected users email address.      Note: This must be a complete and existing email address")
       Cancel = True
    Else
    If IsEmpty(ThisWorkbook.Sheets(1).Range("G10")) Then
       MsgBox ("Please enter expected users full phone number with area code")
       Cancel = True
End If
End If
End If
End If
End If
End If
End If
End If
End Sub
 

Excel Facts

Who is Mr Spreadsheet?
Author John Walkenbach was Mr Spreadsheet until his retirement in June 2019.
I don't understand what you mean by "I can not figure out how to send the code to the user blank." - can you elaborate?
 
Upvote 0
I meant I need to send the workbook to the user with the same cells blank that the code prevents save if blank.
 
Upvote 0
I meant I need to send the workbook to the user with the same cells blank that the code prevents save if blank.
Immediately after the Private Sub.... line add this (change the user name to your user name).

If Environ("USERNAME") = "Your UserName Here" then
Cancel = False
Exit sub
End If
 
Upvote 0

Forum statistics

Threads
1,223,228
Messages
6,170,874
Members
452,363
Latest member
merico17

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top