Hello,
Insofar as I understand your problem here is a track
1) copy the following code in a standard module
'### Adapt the constant ###
Const SOURCE As String = "Sheet1"
'##########################
Sub makeasheet()
Dim mydate As String
Dim S As Worksheet
Application.ScreenUpdating = False
If Sheets(SOURCE).Range("b8") = "" Then
MsgBox "Date not entered in ''B8''"
Exit Sub
End If
mydate = Application.WorksheetFunction.Text(Range("b8"), "dd-mm-yyyy")
On Error Resume Next
Set S = ActiveWorkbook.Sheets(mydate)
If Not S Is Nothing Then
MsgBox "Date in use !" & vbCrLf & "either delete appropriate sheet or use another date", vbInformation
Exit Sub
End If
Err.Clear
On Error GoTo 0
Sheets(SOURCE).Copy After:=Sheets(SOURCE)
Set S = ActiveSheet
S.Name = mydate '///
S.Shapes("Button 1").Delete
With Sheets(SOURCE)
.Range("B2:E6,B8").ClearContents
.Activate
End With
End Sub
2) create your chart in the worksheet "Sheet1", it will automatically be carried in the new sheet set.
Best regards.
PMO
Patrick Morange
Bookmarks