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
 

Excel Facts

Waterfall charts in Excel?
Office 365 customers have access to Waterfall charts since late 2016. They were added to Excel 2019.

JazzSP8

Well-known Member
Joined
Sep 30, 2005
Messages
1,223
Office Version
  1. 2013
  2. 2010
Platform
  1. Windows
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,223
Office Version
  1. 2013
  2. 2010
Platform
  1. Windows
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 :)
 

Watch MrExcel Video

Forum statistics

Threads
1,132,867
Messages
5,655,697
Members
418,230
Latest member
Jimmy_Jef

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Top