I want to declare a variable in vba code of an Excel document and use it in a cell.
Something like this:
Vba Code:
Dim foo as Integer
foo = 2
Excel Cell (any)
=foo
Is that possible?
I want to declare a variable in vba code of an Excel document and use it in a cell.
Something like this:
Vba Code:
Dim foo as Integer
foo = 2
Excel Cell (any)
=foo
Is that possible?
You can declare public function in a code module
Public Function Foo() As Integer
Foo = 2
End Function
and use it in a cell
=Foo()