I am working from an existing workbook in a worksheet(xlsb). I am looking to use a activeX control command button to copy and paste (values only and protect cell values or a value lock) two sheets of existing workbook into a new workbook. I then need a macro to run in the new workbook that deletes column/rows. I am very new to VBA and having no success.
The code is working, but we are looking to make the column/row deletion code of 'Sub Macro_RUN_IN_New_Workbook' execute after the sheets are copy and pasted into the new workbook. Presently the code executes in both the existing workbook and the new workbook. We need the code to run only in the new workbook.
Here is a truncated piece of the code:
Private Sub CommandButton1_Click()
Dim Acmebook As Workbook Dim Acmesheet As Worksheet Set Acmebook = ActiveWorkbook Set Acmesheet = Acmebook.Worksheets("Sheet To Be Copied")
'To remove N/A Sections' If Range("L106:L104").Value = "N/A - N/A" Then
Worksheets(Array("Array1", "Arrays2")).Copy With ActiveWorkbook End With
Sheets("Array1").Cells.Copy Sheets("Array1").Cells.PasteSpecial Paste:=xlPasteValues Application.CutCopyMode = False
Call Worksheets("Array1").Protect(UserInterfaceOnly:=True) End Sub