I created a macro in Excel 2013 and saved it in personal.xlsb. I then went into VBA and added an input into the macro.
-Should I specify this as a function or a sub? I am not sure when to specify one versus the other
-Can a sub have an input?
-example: Public Sub Namecall(Cellinput As String)
-I am in the excel file (macros are enabled) I want to use the macro/function in. When I type in =Namecall(A2), it does not register a function or a macro and gives me the #NAME? error. Why is that? Is there something I need to do?
-Lastly, If I want it to call A2 from the sheet directly in front of the current sheet, how would I write that in VBA?
-I was thinking =Namecall('Priorsheet'!A2)
-Should I specify this as a function or a sub? I am not sure when to specify one versus the other
-Can a sub have an input?
-example: Public Sub Namecall(Cellinput As String)
-I am in the excel file (macros are enabled) I want to use the macro/function in. When I type in =Namecall(A2), it does not register a function or a macro and gives me the #NAME? error. Why is that? Is there something I need to do?
-Lastly, If I want it to call A2 from the sheet directly in front of the current sheet, how would I write that in VBA?
-I was thinking =Namecall('Priorsheet'!A2)