ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   LOG FILE RECORDING USERS TIME (https://www.excelbanter.com/excel-programming/415070-log-file-recording-users-time.html)

SANDIND[_2_]

LOG FILE RECORDING USERS TIME
 
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

Barb Reinhardt

LOG FILE RECORDING USERS TIME
 
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

--
HTH,
Barb Reinhardt



"SANDIND" wrote:

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


SANDIND[_2_]

LOG FILE RECORDING USERS TIME
 
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

"Barb Reinhardt" wrote:

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

--
HTH,
Barb Reinhardt



"SANDIND" wrote:

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


Barb Reinhardt

LOG FILE RECORDING USERS TIME
 
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.
--
HTH,
Barb Reinhardt



"SANDIND" wrote:

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

"Barb Reinhardt" wrote:

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

--
HTH,
Barb Reinhardt



"SANDIND" wrote:

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



All times are GMT +1. The time now is 02:33 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com