Hey,
with the following code I am creating a new worksheet.
However, I want it to overwrite existing sheets with the same name. How can I do that?
Jan
with the following code I am creating a new worksheet.
Code:
Private Sub cmdCreate_Click()
Dim intInlength, intOutlength, intMonth, intYear As Integer
intMonth = cboMonth.Value
Worksheets("Cost Temp").Copy After:=Sheets(Worksheets.Count)
With ActiveSheet
.Name = cboMonth.Value & "-" & cboYear.Value
.Range("C1") = cboMonth.Value
.Range("D1") = cboYear.Value
End With
End Sub
However, I want it to overwrite existing sheets with the same name. How can I do that?
Jan