I have a macro in spreadsheet "A" that opens Spreadsheet "B"
I need to run a macro within spreadsheet "B"
The catch is that I need to pass a parameter to the macro
The macro is called AddUnits and you need to pass a number to it
I tried both
1) Application.Run = "'" + ActiveWorkbook.Name + "'!Addunits " + "10"
and
2) Application.Run = "'" + ActiveWorkbook.Name + "'!Addunits ," + "10"
and
3) Application.Run = "'" + ActiveWorkbook.Name + "'!Addunits " + "(10)"
but all give error messages!
Thank you
Ron
I need to run a macro within spreadsheet "B"
The catch is that I need to pass a parameter to the macro
The macro is called AddUnits and you need to pass a number to it
I tried both
1) Application.Run = "'" + ActiveWorkbook.Name + "'!Addunits " + "10"
and
2) Application.Run = "'" + ActiveWorkbook.Name + "'!Addunits ," + "10"
and
3) Application.Run = "'" + ActiveWorkbook.Name + "'!Addunits " + "(10)"
but all give error messages!
Thank you
Ron
Last edited by a moderator: