I have a macro button that copies the sheet to another sheet and deletes everything from th original to have it blank for the next use. Currently the sheet is going to the end of the lists of sheets but I want it to go to the beginning of the list. My current code is as follows:
I initially had the below part as after and changed it to before and it placed it before all the other sheets in the workbook for one or 2 cycles but then switched back to moving it to the last sheet.
Thanks for any recommendations or advice.
VBA Code:
Public Sub CopySheetAndRenameByCell2()
Dim wks As Worksheet
Set wks = ActiveSheet
ActiveSheet.Copy Before:=Worksheets(Sheets.Count)
If wks.Range("C6").Value <> "" Then
On Error Resume Next
ActiveSheet.Name = wks.Range("C6").Value
End If
Dim B As Button
For Each B In ActiveSheet.Buttons
If B.Caption = "Next MRL" Then
B.Delete 'Delete the button labeled "Run Macro #1"
End If
Next B
wks.Activate
Sheets("New MRL").Range("c3:c5") = ""
Sheets("New MRL").Range("c7:c9") = ""
Sheets("New MRL").Range("c11:d13") = ""
Sheets("New MRL").Range("c21") = ""
Sheets("New MRL").Range("c22") = ""
Sheets("New MRL").Range("c23") = ""
Sheets("New MRL").Range("c24:c27") = ""
Sheets("New MRL").Range("d7") = "T or t"
Sheets("New MRL").Range("c33") = ""
Sheets("New MRL").Range("c37") = ""
Sheets("New MRL").Range("h3") = "Must choose for TKPH"
Sheets("New MRL").Range("h4:h9") = ""
Sheets("New MRL").Range("k3") = "Choose"
Dim pic As Picture
For Each pic In ActiveSheet.Pictures
If pic.Name <> "Logo" Then
pic.Delete
End If
Next pic
End Sub
I initially had the below part as after and changed it to before and it placed it before all the other sheets in the workbook for one or 2 cycles but then switched back to moving it to the last sheet.
VBA Code:
ActiveSheet.Copy Before:=Worksheets(Sheets.Count)
Thanks for any recommendations or advice.