Who inserted sheet?

daanachellam

New Member
Joined
Jul 2, 2011
Messages
1
Hi,

Please let me know who on how to track details of who insterted a new sheet in a shared workbook? Track changes is not helpinng.Please advise.

Regards,
Dyana R
 

Excel Facts

Format cells as date
Select range and press Ctrl+Shift+3 to format cells as date. (Shift 3 is the # sign which sort of looks like a small calendar).
This code in your ThisWorkbook code module should do it but only if macros are enabled:-
Code:
Option Explicit
Private Sub Workbook_NewSheet(ByVal Sh As Object)
 
  Dim iNextRow As Long
  Dim ws As Worksheet
  
  Set ws = Sheets("Log")
  iNextRow = ws.Cells(ws.Rows.Count, 1).End(xlUp).Row + 1
  ws.Cells(iNextRow, 1) = Format(Now(), "dd/mm/yyyy hh:nn:ss")
  ws.Cells(iNextRow, 2) = Environ("username")
   
End Sub
Before inserting this code, create a new worksheet called Log and make it hidden.
 
Last edited:
Upvote 0
Prior to that, I believe, you will have to un-share the workbook to access the VBA modules. So do it when no one else is accessing the workbook.
 
Upvote 0

Forum statistics

Threads
1,224,618
Messages
6,179,917
Members
452,949
Latest member
beartooth91

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
Back
Top