substrak with function

  • Thread starter Thread starter Divine
  • Start date Start date
Hi
you may explain your problem with a little bit more detail. How should
we know what you're trying to achieve :-)
 
Your post is a little vague, can you add a little more
information.

Charlie O'Neill
 
Hi Divine!

Here's to guessing what you want!

To subtract amount in B1 from amount in A1:

=A1-B1

To subtract an amount from a function:

eg

=SUM(A1:A50)-B1

To subtract within a function

eg

=DATE(YEAR(A1)-1,MONTH(A1),DAY(A1)
Subtracts a year from a date in A1

If I haven't guessed right then re-post.

--
Regards
Norman Harker MVP (Excel)
Sydney, Australia
(e-mail address removed)
Excel and Word Function Lists (Classifications, Syntax and Arguments)
available free to good homes.
 
what i meen is
how can i substract with a function
not
a1-a2=....
hope this is more clearly
and thanks for the replie
 
Hi Divine!

Put it round the other way:

=A1-A2


--
Regards
Norman Harker MVP (Excel)
Sydney, Australia
(e-mail address removed)
Excel and Word Function Lists (Classifications, Syntax and Arguments)
available free to good homes.
 
the point is that I need to substract with a function..!
if u can show me the way or show me how to create a new function i`l
be greatful
Thank
 
Hi
could you explain why you need a function (maybe you can give an
example of what you're trying to achieve)?
 
Hi Divine!

Here's the function:

Function Subtract(Num1 As Double, Num2 As Double) As Double
Subtract = Num1 - Num2
End Function

How to get it in your workbook:


Select the function above
Right Click > Copy

Point to the Excel entry on the Start Bar and
Point to a worksheet tab
Right Click > View Code [You're now in the Visual Basic Editor]
Select the name of your workbook in the top left window [The Project
Explorer]
Insert > Module
Right Click > Paste
Point to the Excel icon on top left toolbar
Text

=Subtract(A1,B1)



--
Regards
Norman Harker MVP (Excel)
Sydney, Australia
(e-mail address removed)
Excel and Word Function Lists (Classifications, Syntax and Arguments)
available free to good homes.
 
firest of all thank u all for the replies
im new in excel so sorry for the stupied qustions...
Norman Harker-
this is what i need but when im restaring the excel i need to do al
the steps again..
mabe there is a way to save the function...
 
Hi Divine!

You can store it in your Personal.xls file but first you have to
create it.

With any workbook open
Use:
Tools > Macro > Record new Macro
From the drop down Select "Personal Macro Workbook"
OK

Now record a few format cells instructions
Tools > Macro > Stop Recording.

You now have a Personal.xls file

Use Alt F11 to get to the Visual Basic Editor
Select the Personal workbook in the Project Explorer Window
You can then use Insert Module to create a new Module and put your new
function in that Module.
Save

The Personal.xls file is a hidden workbook that is opened each time
that you open Excel and is ideal for storing functions and subroutines
that only you use.

Sounds like you might be ready for John Walkenbach's Excel 2003 Power
Programming with VBA.

You might also look at:
Dave McRitchie:
http://www.mvps.org/dmcritchie/excel/getstarted.htm

--
Regards
Norman Harker MVP (Excel)
Sydney, Australia
(e-mail address removed)
Excel and Word Function Lists (Classifications, Syntax and Arguments)
available free to good homes.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Back
Top