Public Schedule Face-to-Face & Online Instructor-Led Training - View dates & book

excel 2003 training - excel

Forum home » Delegate support and help forum » Microsoft Excel Training and help » excel 2003 training - Excel

excel 2003 training - Excel

ResolvedVersion Standard

Kevin has attended:
Excel Advanced course

Excel

How do you create a customised function

RE: Excel

Hi Kevin

Thank you for your question.

I think this is best answered with a specific example. We will create a function called VatPre which will take any price that includes VAT and work out the non VAT element of that. Go to the VBE by pressing ALT-F11 and create a new module. In the code window type the following

private function VatPre(VAT as single) as single

vatPre = VAT/1.175

end function


The line "private function VatPre(VAT as single) as single" defines the function as having one argument "VAT" which will be the amount including VAT.

The line "VatPre = VAT/1.175" simply sets the value of the function equal to VAT divided by 1.175.

I hope this helps. If you have any further questions please do not hesitate to ask

Regards

Stephen

Excel tip:

Selecting constant values only

If periodically you need to change all your values back to zero, but leave formulas, text and blank cells as they are select the entire worksheet, choose F5 function key, Special and then Constants and choose the appropriate sub-selections. To enter zero in all the selected cells type 0 and then press Ctrl+Enter.

View all Excel hints and tips

Connect with us:

0207 987 3777

Call for assistance

Request Callback

We will call you back

Server loaded in 0.11 secs.