LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 167
Default Log when cells are copied

Sharon,

Because the procedure use the DataObject variable type, you must have a
reference set in your VBA project to the Microsoft Forms 2.0 object library.

In your VBA window Tools-References... and put a check in the box for
'Microsoft Forms 2.0 Object Library'

Mike

"Sharon" wrote:

Wow!! Thank you so much - going to try it as soon as I have read through it
to understand but it looks absolutely perfect. Thanks again jetted!!
--
Sharon


"jetted" wrote:


Hi Sharon

I would use these 3 macro


Sub auto_open()
'grab the user name
Dim LogFile As String
Dim EnvString As String
Dim Indx As Long
Dim regRoot As Long

Indx = 1
Do
EnvString = Environ(Indx)
If LCase(Left(EnvString, 9)) = "username=" Then 'Lan user id
regUserID = Right(EnvString, Len(EnvString) - 9)
End If
Indx = Indx + 1
Loop Until EnvString = ""
Indx = 0

LogFile = "c:\activite.log" ' this must be a common directory
ChDir "c:\"
donnees = Now()
Open LogFile For Append Shared As #1
Print #1, "Excel was openned at: " & donnees & " by " &
regUserID
Close #1
end sub

Sub AUTO_CLOSE()
'close the file
Dim LogFile As String
Dim EnvString As String
Dim Indx As Long
Dim regRoot As Long

'Dim applicationClass As New AppEventClass
'Set applicationClass.appl = Application


Indx = 1
Do
EnvString = Environ(Indx)
If LCase(Left(EnvString, 9)) = "username=" Then 'Lan user id
regUserID = Right(EnvString, Len(EnvString) - 9)
End If
Indx = Indx + 1
Loop Until EnvString = ""
Indx = 0


LogFile = "c:\activite.log"
ChDir "c:\"
donnees = Now()
Open LogFile For Append Shared As #1 'pointeur adresse,
logfile=#1
Print #1, "Closed excel at " & donnees & " by " & regUserID
Print #1, "----------------------------------"
Close #1
Worksheets("Sheet1").Select
ActiveWorkbook.Save
End Sub

Private Sub Workbook_SheetChange(ByVal Sh As Object, ByVal Target As
Range)
'as soon there is a change this is log
nom = ActiveSheet.Name

refere = Target.Address
LogFile = "c:\activite.log"
ChDir "c:\"
donnees = Now()
oldvalue = ActiveCell.Value
MsgBox oldvalue
Open LogFile For Append Shared As #1
Print #1, "Changes made in workbook: " & nom & " in cell: " &
refere & " new input: " & Target & " " & donnees
Close #1
'MsgBox Target
'MsgBox refere
End Sub


--
jetted
------------------------------------------------------------------------
jetted's Profile: http://www.excelforum.com/member.php...o&userid=17532
View this thread: http://www.excelforum.com/showthread...hreadid=558517




 
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
Insert copied cells Martin B Excel Worksheet Functions 3 August 30th 06 10:47 PM
Prevent certain cells from being copied morins[_2_] Excel Programming 3 May 12th 06 09:34 AM
insert copied cells maryj Excel Discussion (Misc queries) 1 October 24th 05 07:56 PM
How to use macros to copy a range of cells which can exclude some cells which I didn't want to be copied? excelnovice Excel Worksheet Functions 2 September 25th 05 12:38 AM
Formatting copied cells Bret Excel Discussion (Misc queries) 1 July 8th 05 03:29 PM


All times are GMT +1. The time now is 12:37 AM.

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"