Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default control formula with a macro?


I use an invoice form in which I have to charge a tax for some of the
sales, I want to be able to control the formula so it only applies
when I want. Can I do that with a macro? Please Help ME! :(


--
jadeyes2612
------------------------------------------------------------------------
jadeyes2612's Profile: http://www.excelforum.com/member.php...o&userid=25119
View this thread: http://www.excelforum.com/showthread...hreadid=466281

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,163
Default control formula with a macro?

Would need more info: what is your formula, and how do you decide when it
applies? You can probably handle this through normal formulas (no need for a
macro) by using the IF function;
Worksheet version: =IF(condition,formula1,formula2)
applies formula1 if the condition is true, otherwise formula2
Example - I will have it apply a 7% tax if the amount in A1 is greater than
$20, otherwise no tax applies:
=IF(A120,A1*1.07,A1)

If you need to put this in a macro, here is a VBA version:
If Range("A1").Value 20 Then
Tax = Price * 0.07
Else
Tax = 0
End If
Price = Price + Tax
--
- K Dales


"jadeyes2612" wrote:


I use an invoice form in which I have to charge a tax for some of the
sales, I want to be able to control the formula so it only applies
when I want. Can I do that with a macro? Please Help ME! :(


--
jadeyes2612
------------------------------------------------------------------------
jadeyes2612's Profile: http://www.excelforum.com/member.php...o&userid=25119
View this thread: http://www.excelforum.com/showthread...hreadid=466281


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default control formula with a macro?


Hi:

The formula is M36=M35*0.01
What I would like to be able to do is assign a button to run th
formula whenever I want to calculate the tax. I cannot specify th
condition because it's arbitrary, It depends on variuos variables tha
maybe present at the same time but maybe not. That is why I woul
prefer to control when the formula is applied.

thank

--
jadeyes261
-----------------------------------------------------------------------
jadeyes2612's Profile: http://www.excelforum.com/member.php...fo&userid=2511
View this thread: http://www.excelforum.com/showthread.php?threadid=46628

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
control end in a macro Belinda7237 Excel Worksheet Functions 1 May 28th 08 05:22 PM
Control button / macro Sarah Excel Discussion (Misc queries) 2 February 11th 07 04:45 AM
using a cell value to control a counter inside a macro and displaying macro value ocset Excel Worksheet Functions 1 September 10th 06 05:32 AM
How does Solversolve Control Macro Dacvid Cardner Excel Programming 1 June 17th 04 07:41 PM
Macro control Edwin Merced Excel Programming 4 December 5th 03 12:58 AM


All times are GMT +1. The time now is 04:57 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"