Results 1 to 3 of 3

If Code

Threaded View

  1. #1
    Forum Contributor
    Join Date
    09-16-2013
    Location
    Los Angeles, USA
    MS-Off Ver
    Excel 2011
    Posts
    620

    If Code

    how would I code the following:

    If
    Me.Password = aCell.Offset(, 1) 
    &
    Username.Value = Admin
    Then
    Sheets("Users").Range("G1").Value = Username.Value
    Sheets("EquipmentData").Visible = True
    Sheets("ReturnData").Visible = True
    Sheets("Search").Visible = True
    Sheets("EmailSettings").Visible = True
    Sheets("RentalHouses").Visible = True
    Sheets("UnitList").Visible = True
    Sheets("Users").Visible = True
    Sheets("Welcome").Visible = xlVeryHidden
    Sheets("ReturnData").Activate
    Unload Me
    If
    Me.Password = aCell.Offset(, 1) 
    &
    Username.Value = 'Anything other than Admin'
    Then
    Sheets("Users").Range("G1").Value = Username.Value
    Sheets("EquipmentData").Visible = True
    Sheets("ReturnData").Visible = True
    Sheets("Search").Visible = True
    Sheets("EmailSettings").Visible = True
    Sheets("RentalHouses").Visible = True
    Sheets("UnitList").Visible = True
    Sheets("Users").Visible = True
    Sheets("Welcome").Visible = xlVeryHidden
    Sheets("ReturnData").Activate
    Unload Me
    Else (to the original IF)
    MsgBox "Incorrect password, please try again", vbOKOnly
    Last edited by Nitefox; 02-23-2014 at 02:56 PM.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Replies: 2
    Last Post: 12-17-2013, 11:51 AM
  2. Replies: 2
    Last Post: 03-09-2013, 04:30 AM
  3. Adding Text to another cell VB code (Help Tweeking code) (Excel 2007)
    By Excelnoub in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 12-06-2012, 11:37 AM
  4. Replies: 2
    Last Post: 03-17-2011, 08:55 PM
  5. Replies: 0
    Last Post: 10-06-2006, 09:05 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1