Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming,microsoft.public.excel.misc
external usenet poster
 
Posts: 14
Default creating a log sheet

Hi all,

I've created a method to capture current user (network username) and a date
/ time stamp. I want this output to be logged on a hidden sheet called
'log' strangely enough! How does it find the next available line in log to
output to?

tia


  #2   Report Post  
Posted to microsoft.public.excel.programming,microsoft.public.excel.misc
external usenet poster
 
Posts: 2,494
Default creating a log sheet

see if this will help you. you didn't give too specific of a description, so
hopefully this is what you're looking for

lastRow = Worksheets("log").Cells(Rows.Count, "A").End(xlUp).Row

range("A: & lastrow +1) = "your date/time stamp code"


--


Gary


"sacrum" wrote in message
...
Hi all,

I've created a method to capture current user (network username) and a
date / time stamp. I want this output to be logged on a hidden sheet
called 'log' strangely enough! How does it find the next available line
in log to output to?

tia



  #3   Report Post  
Posted to microsoft.public.excel.programming,microsoft.public.excel.misc
external usenet poster
 
Posts: 14
Default creating a log sheet


"Gary Keramidas" <GKeramidasATmsn.com wrote in message
...
see if this will help you. you didn't give too specific of a description,
so hopefully this is what you're looking for

lastRow = Worksheets("log").Cells(Rows.Count, "A").End(xlUp).Row

range("A: & lastrow +1) = "your date/time stamp code"


--


Gary


"sacrum" wrote in message
...
Hi all,

I've created a method to capture current user (network username) and a
date / time stamp. I want this output to be logged on a hidden sheet
called 'log' strangely enough! How does it find the next available line
in log to output to?

tia


Gary thanks - sorry for not being clear - here is the unworking script:

Private Sub Workbook_open()
Worksheets("Frontscreen").Activate
ActiveSheet.Unprotect

Dim x
Set x = CreateObject("WSCRIPT.Network")
Dim u
u = x.UserName
t = Time
'update text box "Last Updated:"
ActiveSheet.TextBoxes("txtLogon").Text = "Welcome to IRIS " & u & " -
Access Time: " & t
ActiveSheet.Protect


lastrow = Worksheets("log").Cells(Rows.Count, "A").End(xlUp).Row
Loglisting = txtLogon.Value

Worksheets("Log").Range("A" & lastrow + 1).Value = Loglisting

End Sub
Basically when workbook opens the current user is identified and displayed
using text box. I want this value to be copied to the next available line
in a log worksheet that is hidden from the user.


  #4   Report Post  
Posted to microsoft.public.excel.programming,microsoft.public.excel.misc
external usenet poster
 
Posts: 35,218
Default creating a log sheet

Since you're creating a log, I would think that you would want to include the
date as well as the time. Although, you may not want to include that in the
textbox.

But something like this may work ok:

Option Explicit
Private Sub Workbook_open()
Dim x As Object
Dim u As String
Dim t As Date
Dim LastRow As Long

Set x = CreateObject("WSCRIPT.Network")

With Worksheets("FrontScreen")
.Activate
.Unprotect
u = x.UserName
t = Now
'update text box "Last Updated:"
.TextBoxes("txtLogon").Text _
= "Welcome to IRIS " & u & " - Access Time: " _
& Format(t, "hh:mm:ss")
.Protect
End With

With Worksheets("Log")
LastRow = Worksheets("log").Cells(.Rows.Count, "A").End(xlUp).Row
With .Cells(LastRow + 1, "A")
.Value = u
With .Offset(0, 1)
.Value = t
.NumberFormat = "mm/dd/yyyy hh:mm:ss"
End With
End With
End With

End Sub

I also put the name and date/time in two different columns.

Remember that this log entry will be lost if the workbook is closed without
saving.

sacrum wrote:

"Gary Keramidas" <GKeramidasATmsn.com wrote in message
...
see if this will help you. you didn't give too specific of a description,
so hopefully this is what you're looking for

lastRow = Worksheets("log").Cells(Rows.Count, "A").End(xlUp).Row

range("A: & lastrow +1) = "your date/time stamp code"


--


Gary


"sacrum" wrote in message
...
Hi all,

I've created a method to capture current user (network username) and a
date / time stamp. I want this output to be logged on a hidden sheet
called 'log' strangely enough! How does it find the next available line
in log to output to?

tia


Gary thanks - sorry for not being clear - here is the unworking script:

Private Sub Workbook_open()
Worksheets("Frontscreen").Activate
ActiveSheet.Unprotect

Dim x
Set x = CreateObject("WSCRIPT.Network")
Dim u
u = x.UserName
t = Time
'update text box "Last Updated:"
ActiveSheet.TextBoxes("txtLogon").Text = "Welcome to IRIS " & u & " -
Access Time: " & t
ActiveSheet.Protect

lastrow = Worksheets("log").Cells(Rows.Count, "A").End(xlUp).Row
Loglisting = txtLogon.Value

Worksheets("Log").Range("A" & lastrow + 1).Value = Loglisting

End Sub
Basically when workbook opens the current user is identified and displayed
using text box. I want this value to be copied to the next available line
in a log worksheet that is hidden from the user.


--

Dave Peterson
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Creating a new sheet from specific data in existing sheet Rosscoe Excel Discussion (Misc queries) 2 January 13th 10 03:07 PM
creating a sheet 1 of Lenny Excel Worksheet Functions 3 October 14th 09 01:32 PM
Creating form on sheet 1 and having info move to sheet 2 SHARON Excel Discussion (Misc queries) 4 June 1st 09 05:01 PM
creating sub-sheet pkeegs Excel Discussion (Misc queries) 0 November 29th 06 08:26 PM
Creating a new sheet TyeJae[_23_] Excel Programming 2 July 27th 04 10:20 PM


All times are GMT +1. The time now is 07:20 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"