fareedexcel
Member
Hi,
I have 2 macro, when I run the code using Alt + F11, it is working fine. I try to assign the code using command button and when I click the button, the button gets deleted and the code result populates in the column A.
Is there any way to keep the button enabled, so that every time i dont want to assign control.
These are my two codes where I would like to keep in the Tab Summary Page with command buttons,
CODE 1 :
CODE 2:
I have 2 macro, when I run the code using Alt + F11, it is working fine. I try to assign the code using command button and when I click the button, the button gets deleted and the code result populates in the column A.
Is there any way to keep the button enabled, so that every time i dont want to assign control.
These are my two codes where I would like to keep in the Tab Summary Page with command buttons,
CODE 1 :
Sub ListWorkSheetNamesNewWs()
Dim checklist As Worksheet
On Error Resume Next
Application.DisplayAlerts = False
xTitleId = "Tab Summary"
Application.Sheets(xTitleId).Delete
Application.Sheets.Add Application.Sheets(1)
Set checklist = Application.ActiveSheet
checklist.Name = xTitleId
For I = 2 To Application.Sheets.Count
checklist.Range("A" & (I - 1)) = Application.Sheets(I).Name
Next
Application.DisplayAlerts = True
End Sub
CODE 2:
Public Sub DeleteCompletelyBlankRows()
Dim WS As Worksheet
Dim R As Long
On Error GoTo EndMacro
Application.ScreenUpdating = False
Application.Calculation = xlCalculationManual
For Each WS In Worksheets
With WS.UsedRange
For R = .Rows.Count To 1 Step -1
If Application.WorksheetFunction.CountA(.Rows(R).EntireRow) = 0 Then
.Rows(R).EntireRow.Delete
End If
Next R
End With
Next WS
EndMacro:
Application.ScreenUpdating = True
Application.Calculation = xlCalculationAutomatic
End Sub