I am trying to write a generic subroutine that is called from clicking a command_button. No problem so far.
The code is:
What I want to do is populate the public variable "Reporting_Unit" with the name of the current subroutine, along the lines of Reporting_Unit = this.name.value as in javascript.
I can then pass the name of the current sub to the called routine where it will be used in range/db selection criteria. The trouble is, I don't know the syntax to detect the name of the currently executing subroutine.
In addition, I am still being prompted to accept or decline the cell update , even though I have coded "Application.DisplayAlerts = False" ?
Thanks
The code is:
Code:
Private Sub ACAT_New_Click()
Application.DisplayAlerts = False
Reporting_Unit = ACAT_NEW.Name
Application.DisplayAlerts = True
' Pass the name of this Command Button to the Pivot table sub.
Call Pivot_Acat(Reporting_Unit)
End Sub
What I want to do is populate the public variable "Reporting_Unit" with the name of the current subroutine, along the lines of Reporting_Unit = this.name.value as in javascript.
I can then pass the name of the current sub to the called routine where it will be used in range/db selection criteria. The trouble is, I don't know the syntax to detect the name of the currently executing subroutine.
In addition, I am still being prompted to accept or decline the cell update , even though I have coded "Application.DisplayAlerts = False" ?
Thanks