Usage Tracker

INSONIC

New Member
Joined
Jul 30, 2010
Messages
3
Hi all, i'm new to the site.

I have to produce a weekly report in excel and i want to track who open the report.

I have a script that tracks it in the document, but i want it to write it to another excel document on a shared drive, as not everyone saves it.

UserName = Environ("UserName")
myUser = "User: " & UserName & _
", On: " & Application.WorksheetFunction.Text(Now(), "m/d/yyyy at hh:mm AM/PM")
Worksheets("usage").Range("A65536").End(xlUp).Offset(1, 0).Value = myUser
End Sub
 

Some videos you may like

Excel Facts

What is =ROMAN(40) in Excel?
The Roman numeral for 40 is XL. Bill "MrExcel" Jelen's 40th book was called MrExcel XL.

JazzSP8

Well-known Member
Joined
Sep 30, 2005
Messages
1,218
Welcome to the site! :)

Can't you just save the workbook as soon as you've wrote to the cell?

Code:
UserName = Environ("UserName")
myUser = "User: " & UserName & _
", On: " & Application.WorksheetFunction.Text(Now(), "m/d/yyyy at hh:mm AM/PM")
Worksheets("usage").Range("A65536").End(xlUp).Offset(1, 0).Value = myUser

ActiveWorkbook.Save

End Sub
Thats how I do it :)
 

INSONIC

New Member
Joined
Jul 30, 2010
Messages
3
The only problem i have, is that around 20 people could open the document at any time, so they would open it as a read only, not saving on the document, this way it would write straight to another document that i could have auto save. i dont want to share the document due to errors i find normally.

Thanks everyone for your help
 

JazzSP8

Well-known Member
Joined
Sep 30, 2005
Messages
1,218
Ah - Sorry, bit of a lazy post there...

Try this :)

Code:
Dim wb As Workbook
    Set wb = Workbooks.Open("test.xls")
        wb.Sheets("usage").Select
        UserName = Environ("UserName")
        myUser = "User: " & UserName & _
        ", On: " & Application.WorksheetFunction.Text(Now(), "m/d/yyyy at hh:mm AM/PM")
        Worksheets("usage").Range("A65536").End(xlUp).Offset(1, 0).Value = myUser
        wb.Close savechanges:=True
Obivously replace "test.xls" with your Workbook that you want to record your details in :)
 

Subscribe on YouTube

Watch MrExcel Video

Forum statistics

Threads
1,106,017
Messages
5,508,827
Members
408,696
Latest member
stunik94

This Week's Hot Topics

  • Turn fraction around
    Hello I need to turn a fraction around, for example I have 1/3 but I need to present as 3/1
  • TIme Clock record reformatting to ???
    Hello All, I'd like some help formatting this (Tbl-A)(Loaded via Power Query) [ATTACH type="full" width="511px" alt="PQdata.png"]22252[/ATTACH]...
  • TextBox Match
    hi, I am having a few issues with my code below, what I need it to do is when they enter a value in textbox8 (QTY) either 1,2 or 3 the 3 textboxes...
  • Using Large function based on Multiple Criteria
    Hello, I can't seem to get a Large formula to work based on two criteria's. I can easily get a oldest value based one value, but I'm struggling...
  • Can you check my code please
    Hi, Im going round in circles with a Compil Error End With Without With Here is the code [CODE=rich] Private Sub...
  • Combining 2 pivot tables into 1 chart
    Hello everyone, My question sounds simple but I do not know the answer. I have 2 pivot tables and 2 charts that go with this. However I want to...
Top