kelly mort
Well-known Member
- Joined
- Apr 10, 2017
- Messages
- 2,169
- Office Version
- 2016
- Platform
- Windows
I have this code here and when I call the InputBox only the admin will match. All the others return the else statement. So I used that UCase but still. What is it that I am missing?
The account names :
Code:
Option Explicit
Private UName As Variant, TheAccount As Variant
Sub ActiveInactive ()
TheAccount = Application.InputBox("Enter the Account name","Activate or Deactivate")
With Sheets("Data")
For Each UName In . [K4:K13]
If UName = UCase(TheAccount) Then
MsgBox "Account available"
Else
MsgBox "Account not available"
End If
Next
End With
End Sub
The account names :
Code:
ADMIN
USER 1
USER 2
USER 3