Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Note the 3rd line of code from the end where
I instruct my code to copy my entire sheet1 in order To paste it to a newly created sheet (NewSheet) Why does a new workbook get created with the copy? TIA, Private Sub Worksheet_Change(ByVal Target As Range) If Intersect(Target, Range("d2")) Is Nothing Then Exit Sub End If If Target.Address = "$D$2" Then Sheets.Add After:=Worksheets(Worksheets.Count - 2) End If NewSheet = ActiveSheet.Name Sheets("Sheet1").Activate ActiveSheet.Copy '' <<<< ????? Why does this line Open a New ' Workbook an Copy my data into it <<the new ' workbook? Sheets(NewSheet).Activate ActiveSheet.Paste End Sub |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Worksheet Event Code | Excel Programming | |||
help worksheet event code | Excel Programming | |||
Add event code through a macro | Excel Programming |