Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Simple VBA
Hello - I'm trying to write a simple VBA function to calc Income Tax given a
value for income. I have several worksheets in my workbook. From sheet 1 I want to set a value in the Income_Tax sheet, have it do the calc, then return the results. Here's what I got: Function IncomeTax(Income As Double) As Double ActiveWorkbook.Sheets("Income_Tax").Range("A1").Va lue = Income ActiveWorkbook.Sheets("Income_Tax").Range("B1").Ca lculate IncomeTax = ActiveWorkbook.Sheets("Income_Tax").Range("B1").Va lue End Function But when I try to use that function in sheet 1, I get a #Value! error. What's wrong with this code? Thanks for your help. -- Tony |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
IF formula-simple question; simple operator | Excel Discussion (Misc queries) | |||
Simple problem, simple formula, no FUNCTION ! | Excel Worksheet Functions | |||
Simple Simple Excel usage question | Excel Discussion (Misc queries) | |||
Make it more simple or intuitive to do simple things | Charts and Charting in Excel | |||
simple question, hopefully a simple answer! | Excel Programming |