Solved

Excel VB

Posted on 2016-11-07
2
21 Views
Last Modified: 2016-11-07
Hi I want to change this code to add in another user so Richard Atkinson + Bob Smith not sure on how I do that is it an or ?



Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As Boolean)
 If Application.UserName = "Richard Atkinson" Then
    If WorksheetFunction.CountA(Sheets("Order Form").Range("K6,K7")) < 2 Then
        Msg = MsgBox("K6 and K7 need to be populated to continue - Thanks" _
                & vbCrLf & "Do you really want to save?", vbYesNo)
        If Msg = vbYes Then
            Cancel = False
        Else
            Cancel = True
        End If
    End If
0
Comment
Question by:RichardAtk
2 Comments
 
LVL 32

Accepted Solution

by:
Rob Henson earned 500 total points
ID: 41877460
If Application.UserName = "Richard Atkinson" Or Application.UserName = "Bob Smith" Then
0
 

Author Closing Comment

by:RichardAtk
ID: 41877462
Perfect thanks
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

What is a Form List Box? (skip if you know this) The forms List Box is the alternative to the ActiveX list box. If you are using excel 2007, you first make sure you have a developer tab (click the Orb)->"Excel Options"->Popular->"Show Developer tab…
Sparklines have been introduced with Excel 2010 and are a useful tool for creating small in-cell charts, used for example in dashboards. Excel 2010 offers three different types of Sparklines: Line, Column and Win/Loss. What it does not offer is a…
The viewer will learn how to use the =DISCRINV command to create a discrete random variable, use this command to model a set of probabilities and outcomes in a Monte Carlo simulation, and learn how to find the standard deviation of a set of probabil…
The viewer will learn how to create two correlated normally distributed random variables in Excel, use a normal distribution to simulate the return on different levels of investment in each of the two funds over a period of ten years, and, create a …

943 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

5 Experts available now in Live!

Get 1:1 Help Now