+ Reply to Thread
Results 1 to 2 of 2

This place is great! User Log help required

  1. #1
    Forum Contributor
    Join Date
    12-16-2006
    Posts
    349

    This place is great! User Log help required

    Private Sub Log()


    Open ThisWorkbook.Path & "\usage.log" For Append As #1
    Print #1, Application.UserName, Now
    Close #1

    End Sub

    However this prints the user log in a text file, I want it to print it on the same file being opened but on sheet 10 can you help ?

  2. #2
    Forum Contributor
    Join Date
    09-28-2006
    Posts
    122

    try this

    this code should do the trick, you need to decide where to put it, maybe on the workbook open event

    code is as follows

    Sub Log()
    '
    '
    Dim LastRow
    'find last row used in sheet10 log list
    '
    LastRow = Sheets("Sheet10").Cells(Rows.Count, "A").End(xlUp).Row
    Sheets("Sheet10").Cells(LastRow + 1, 1).Value = Application.UserName
    Sheets("Sheet10").Cells(LastRow + 1, 2).Value = Now

    End Sub
    HTH

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1