I have a workbook that has an initial form that I fill out and once I'm done I press a form control button that copies everything to a new sheet and deletes all input information from the initial form except the logo and the form control box. Currently the form control box stays active in the new sheets so I need to delete the form control box before making the new sheet. Current code below work perfectly minus deleting the form control box.
I attempted to delete button with the line shown but as I'm not super familiar with VBA I'm sure I'm doing something wrong. Thanks
VBA Code:
Public Sub CopySheetAndRenameByCell2()
Dim wks As Worksheet
Set wks = ActiveSheet
ActiveSheet.Copy Before:=Worksheets(Sheets.Count)
If wks.Range("C3").Value <> "" Then
On Error Resume Next
ActiveSheet.Name = wks.Range("C3").Value
End If
Shapes.Range(Array("Button 1")).Delete 'Used this to try to delete button
wks.Activate
Sheets("New MRL").Range("c3:c7") = ""
Sheets("New MRL").Range("c9:d11") = ""
Sheets("New MRL").Range("c19:c25") = ""
Sheets("New MRL").Range("h3") = ""
Sheets("New MRL").Range("d5") = ""
Sheets("New MRL").Range("c31") = ""
Sheets("New MRL").Range("h2:h5") = ""
Dim pic As Picture
For Each pic In ActiveSheet.Pictures
If pic.Name <> "Logo" Then
pic.Delete
End If
Next pic
End Sub
I attempted to delete button with the line shown but as I'm not super familiar with VBA I'm sure I'm doing something wrong. Thanks