View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
FSt1 FSt1 is offline
external usenet poster
 
Posts: 3,942
Default Detect New Worksheet being added

hi
Private Sub Workbook_NewSheet(ByVal Sh As Object)
Sheets("sheet1").Range("B2").Value = "PSST!"
Sheets("sheet1").Range("B3").FormulaR1C1 = _
"Someone added a sheet."
Sheets("Sheet1").Range("B4").Value = _
Application.UserName 'pc name
' eviron("username")= network name
Sheets("sheet1").Range("B5").Value = Now()
Sheets("sheet1").Range("B6").Value = "Have a nice day. :-)"
End Sub

this is thisworkbook code.

regards
FSt1

"sharonm" wrote:

Hello,

Is there a way to detect if a user has created a new worksheet in a workbook?

Whenever a user has created a new sheet, I need to populate some cells on
the Master sheet (1st tab) plus reference the newly added worksheet from the
user.

Any suggesstions would be greatly appreciated. Thanks!