zendog1960
Active Member
- Joined
- Sep 27, 2003
- Messages
- 459
- Office Version
- 2019
- Platform
- Windows
How would I modify the following specific code to run when just one cell changes? It is running now when anything on the sheet changes as I am aware that that is what the code currently is supposed to do.
Code:
Private Sub Worksheet_Change(ByVal Target As Range)
Copy_Sheet
End Sub
Sub Copy_Sheet()
Dim wSht As Worksheet
Dim shtName As String
shtName = Sheets("Location Summary").Range("J11")
For Each wSht In Worksheets
If wSht.Name = shtName Then
MsgBox "Sheet already exists...Make necessary " & _
"corrections and try again."
Exit Sub
End If
Next wSht
Sheets("Template").Copy After:=Sheets("Coin Count")
Sheets("Template").Name = shtName
Sheets(shtName).Move After:=Sheets("Location Summary")
Sheets(shtName).Range("A1") = shtName
Sheets("Template (2)").Name = ("Template")
Sheets("Location Summary").Activate
End Sub