View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Paul Black Paul Black is offline
external usenet poster
 
Posts: 394
Default Input Values Instead of Hard Coded Values

Hi Everybody,

I have a Macro that Works Well. The Only Problem is that ALL the
Values ( Data ) I Use are Hard Coded in the Macro.
What would I Need to do ( and How would I go About it ) if I Wanted
the Macro to Pick Up the Values ( Data ) from a Table or Something
Instead of having them Hard Coded in the Macro. The Hard Coded Values
( Data ) Used are NOT in the Workbook and will Change Constantly. I
Really want to be Able to Input the Values Somewhere and then Run the
Macro as Often as Necessary.
Below are 2 Examples of Working Functions :-


Function Difference1()
Difference1 = False
If _
A = 1 And A <= 3 And _
B = 2 And B <= 7 And _
C = 3 And C <= 10 And _
D = 5 And D <= 13 And _
E = 12 And E <= 17 And _
F = 16 And F <= 20 Then _
Difference1 = True
End Function

Function Difference2()
Difference2 = False
If _
B - A <= 5 And _
C - B <= 7 And _
D - C <= 8 And _
E - D <= 10 And _
F - E <= 12 Then _
Difference2 = True
End Function

Any Help will be Greatly Appreciated.
All the Best
Paul
Windows XP Home - XL2002