Posts by akrasia

    Hello!


    I've been trying to get my login userform to login when clicked based on data in a table in the workbook, but I just can't seem to get the code right.


    Details are:
    Userform username textbox = UsernameTextbox
    Userform password textbox = PasswordTextbox
    Userform submit button = LoginButton


    My workbook has a number of sheets, one of which is "Users". In that sheet, there is a table called "Users_Table". That table has 3 columns: Username [Column A], Password [Column B], Admin (answer is "True" or "False" depending on if they have admin rights) [Column C].


    I'm trying to do this:
    If the username and password is correct for a user AND if the admin column entry is False, then I want to show sheets "Quick Add" and "Overview", I want to make the sheet "Admin" hidden (not VeryHidden since I need to use data on this sheet for other macros), and make "User" sheets VeryHidden so those logged in can't see other users' details. But for users who correctly enter their username and password AND for whom the admin column entry is True, I want to show all sheets. If the username/password combo is incorrect, I want all sheets to be hidden.


    Based on what I've found here, I've been playing with some code and I'm nearly there ( I think!). This is what I'm working with:



    I'm just not sure how I'd go about adding in the Admin requirement mentioned above. I need Admins ("True" in "Admin" column, i.e. Column D, in the "Users_Table") to be able to see all sheets; the code above is just for Users and shows "Quick Add" and "Overview" but hides "Admin" and "Users".


    I also think for the Admins I could Call this macro instead of specifying xlSheetVisible for all sheets, but I haven't got that far yet:


    Code
    Sub Unhide_All_Sheets()
    Dim ws As Worksheet
    For Each ws In ActiveWorkbook.Worksheets
    ws.Visible = xlSheetVisible
    Next ws
    End Sub


    I'm fairly new to VBA and I'm trying to teach myself, but I think I'm at an impasse.


    Trying to do this is driving me mad. Any help at all would be much appreciated!


    Thanks for looking and for your time.

    Re: Find text in column then (in that row) add today's date in another column


    Hi Luke,


    The works a treat, thank you! Thanks for the guidance so I know what each step does too.


    May I ask: this table will have the cells changed from other values (e.g. '"In Progress") to "Completed" periodically, and I'll assign this macro to a button and run it daily to populate the Dates for newly "Completed" rows. However, will running this macro change every row that had "Completed" in to today's date? Do I need to add in a step to search only blank cells?


    Thank you for your help, I really appreciate it.


    *********
    Also, minor edit to Luke's code for anyone else using it, you need to remove the extra "/" at the end of "yyyy".

    Hello. I have a table ("Priorities_Table") in a Worksheet ("Overview"). The table has a column range from A:P.


    I'm looking to find the rows in which the text "Completed" is found in column I (column named "Progress") and then, in the row it's been found, add today's date (as text that won't be updated and in format DD/MM/YYY) in column M.


    I've found a way to find the text "Completed" in column I, but I can't find how to do the rest.


    This is what I've got:



    N.B. The message boxes are just there so I know it works ok, and the

    Code
    ActiveCell.EntireRow.Cells(1, "M") = "DATE"


    was my attempt at doing the rest but it just adds "DATE" to whichever cell I'm in.


    Any help would be greatly appreciated!