1.添加新的worksheet并检查是否存在,如果存在,则清楚里面的所有数据。
Sub Add_Sheet(shtName As String)
Dim wSht As Worksheet
For Each wSht In Worksheets
If wSht.Name = shtName Then
Sheets(shtName).Cells.Clear '清除所有数据
Sheets(shtName).Activate 'focus
Exit Sub
End If
' MsgBox ActiveSheet.Name
Next wSht
Sheets.Add.Name = shtName
Sheets(shtName).Move After:=Sheets(Sheets.Count)
End Sub