[Last Call] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 54
  • Last Modified:

Excel VB

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
RichardAtk
Asked:
RichardAtk
1 Solution
 
Rob HensonIT & Database AssistantCommented:
If Application.UserName = "Richard Atkinson" Or Application.UserName = "Bob Smith" Then
0
 
RichardAtkAuthor Commented:
Perfect thanks
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Tackle projects and never again get stuck behind a technical roadblock.
Join Now