I have code here that copies a sheet from the workbook to the end of workbook renames it and clears the data from the original sheet copied the problem is it clears the content in the copied sheet also.
Sub CopyRename()
Dim wsName As Variant
Sheets("Reports").Unprotect Password:="Dan"
Sheets("LinenData").Unprotect Password:="Dan"
With ThisWorkbook
Worksheets("Reports").Copy after:=Sheets(Sheets.Count)
End With
wsName = InputBox("Enter name for new worksheet", "New sheet")
If wsName <> "" Then
With ActiveSheet
.Name = wsName
.Visible = True
End With
Sheets("LinenData").Select
Range("A2:G1174").Select
Selection.ClearContents
Sheets("Reports").Protect Password:="Dan"
Sheets("LinenData").Protect Password:="Dan"
End If
End Sub
Thanks for the assistance fellow Excellers!
LeapingLizard
Bookmarks