ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   User Defined Function: Format Output (https://www.excelbanter.com/excel-programming/295655-user-defined-function-format-output.html)

Kenny

User Defined Function: Format Output
 
If i am using a user defined function (VBA code)

i.e.

Function TestFunc(Input Variables etc...) As Variant

'Code here

TestFunc = "Result of Code"

End Function

How is cell formatting applied similar to the way the
excel function PMT() changes format to red if output value
is negative.

Bob Phillips[_6_]

User Defined Function: Format Output
 
That is done in the cell format.

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)

"Kenny" wrote in message
...
If i am using a user defined function (VBA code)

i.e.

Function TestFunc(Input Variables etc...) As Variant

'Code here

TestFunc = "Result of Code"

End Function

How is cell formatting applied similar to the way the
excel function PMT() changes format to red if output value
is negative.




No Name

User Defined Function: Format Output
 
But how is it done automatically from a user defined excel
function?

-----Original Message-----
That is done in the cell format.

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)

"Kenny" wrote in

message
...
If i am using a user defined function (VBA code)

i.e.

Function TestFunc(Input Variables etc...) As Variant

'Code here

TestFunc = "Result of Code"

End Function

How is cell formatting applied similar to the way the
excel function PMT() changes format to red if output

value
is negative.



.


Jerry W. Lewis

User Defined Function: Format Output
 
A VBA function called from a worksheet can only return a value, it
cannot modify the environment in any way. In particular, it cannot
change cell formats.

Jerry

wrote:

But how is it done automatically from a user defined excel
function?


-----Original Message-----
That is done in the cell format.

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)

"Kenny" wrote in

message

...

If i am using a user defined function (VBA code)

i.e.

Function TestFunc(Input Variables etc...) As Variant

'Code here

TestFunc = "Result of Code"

End Function

How is cell formatting applied similar to the way the
excel function PMT() changes format to red if output

value

is negative.



Kenny

User Defined Function: Format Output
 
So how is cell formatting applied when using the excel
finance function PMT()?

-----Original Message-----
A VBA function called from a worksheet can only return a

value, it
cannot modify the environment in any way. In particular,

it cannot
change cell formats.

Jerry

wrote:

But how is it done automatically from a user defined

excel
function?


-----Original Message-----
That is done in the cell format.

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing

direct)

"Kenny" wrote in

message

.. .

If i am using a user defined function (VBA code)

i.e.

Function TestFunc(Input Variables etc...) As Variant

'Code here

TestFunc = "Result of Code"

End Function

How is cell formatting applied similar to the way the
excel function PMT() changes format to red if output

value

is negative.


.


Jerry W. Lewis

User Defined Function: Format Output
 
PMT() is not a VBA function. Not everything that Excel can do is
exposed for developer use.

Jerry

Kenny wrote:

So how is cell formatting applied when using the excel
finance function PMT()?


-----Original Message-----
A VBA function called from a worksheet can only return a

value, it

cannot modify the environment in any way. In particular,

it cannot

change cell formats.

Jerry

wrote:


But how is it done automatically from a user defined

excel

function?



-----Original Message-----
That is done in the cell format.

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing

direct)

"Kenny" wrote in


message


. ..


If i am using a user defined function (VBA code)

i.e.

Function TestFunc(Input Variables etc...) As Variant

'Code here

TestFunc = "Result of Code"

End Function

How is cell formatting applied similar to the way the
excel function PMT() changes format to red if output


value


is negative.

.





All times are GMT +1. The time now is 01:48 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com