Solved

Excel VB

Posted on 2016-11-07
2
17 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 31

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

What Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

Join & Write a Comment

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…
Drop Down List with Unique/Distinct Values (enhancing the Combo-Box with a few steps and a little code) David miller (dlmille) Intro Have you ever created a data validation list from a database field or spreadsheet column (e.g., Zip Codes or Co…
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 …
This Micro Tutorial will demonstrate in Microsoft Excel how to add style and sexy appeal to horizontal bar charts.

747 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

12 Experts available now in Live!

Get 1:1 Help Now