excel vba call subroutine with variables

You would call the sub as EnterCellValueMonthNumber “N23:Q23”, 1 No brackets. Or Call EnterCellValueMonthNumber(“N23:Q23”, 1) Brackets, and Call before it. Also, your Sub is expecting a Range object as the first argument and you’re supplying a string; you should change the signature of the sub to: Sub EnterCellValueMonthNumber(cells As String, number As Integer) Also, I’m … Read more

Perl – Subroutine redefined

Do you have a dependency loop? If Perl starts compiling your script and encounters a line like this: use PackageA; Perl pauses the compilation of your script; locates PackageA.pm and starts compiling it. If it encounters a line like this: use PackageB; Perl pauses the compilation of PackageA; locates PackageB.pm and starts compiling it. Normally, … Read more

How to alias a function name in Fortran

Yes, Fortran has procedure pointers, so you can in effect alias a function name. Here is a code example which assigns to the function pointer “f_ptr” one function or the other. Thereafter the program can use “f_ptr” and the selected function will be invoked. module ExampleFuncs implicit none contains function f1 (x) real :: f1 … Read more