LOG FILE RECORDING USERS TIME

S

SANDIND

Hi all,

I have one sheet wherein I have allowed access to certain users, who need to
enter threi user id and password to get access to sheet. User Id and password
are verifed from another sheet "Password.xls" who has ID and realted password.

I want to have on log recording User id with time of Log in and Log out in a
separate file may be .xls or any doc file.

Thanks for help in advance.
SS
 
B

Barb Reinhardt

I'd probably put this in another worksheet in the workbook and make it very
hidden.

Column 1: UserID
Column 2: LogIn
Column 3: "LogOut" which would be on Workbook close.

Use something like this

On LogIn
Dim LogFileWS as Worksheet
Set LogFileWS = Worksheets("LogFile")

lRow = LFWS.cells(LFWS.rows.count,1).end(xlup).row
LFWS.cells(lRow+ 1,1) = UserID
LFWS.cells(lRow+1,1) = Date + Time

Put this in the Workbook_Close event
Dim LogFileWS as Worksheet
Set LogFileWS = Worksheets("LogFile")

lRow = LFWS.cells(LFWS.rows.count,1).end(xlup).row
LFWS.cells(lRow,3) = Date + Time
 
S

SANDIND

Hi Barb,

Thanks for your quick reply. I am sorry, I am new to VB, should have
informed that earlier, sorry for that.

Can you please let me know where to put the codes, as I am getting some line
RED when I am copying this code in THIS WORKBOOK.

and one more thing, will ID will be picked automatically as I have given ID
in another sheet and I run one Inpot Box to enter ID and Password to verify
the same.

Thanks again for your kind help.
SS
 
B

Barb Reinhardt

You may be getting red lines because the line of the code splits and you
don't have " _" at the end of the line. Just make sure you have that.

In the ThisWorkbook module, make sure you have selected Workbook and CLOSE
at the top of the screen and enter the info there as needed.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top