#1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default excel 2000

Can Excel be used to write a program that evaluates a list
of variables and controls the order of computations by
utilizing "IF ___, THEN ___, ELSE ___" and "GO TO ___"
statements. If so, how?
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 31
Default excel 2000

Al

Here's one way

Sub TestCalc()
Dim data1 As Range, data2 As Range
Dim TestVar
Dim result As Double

TestVar = Range("B1")
Set data1 = Range("A4:A7")
Set data2 = Range("B4:B7")

If TestVar 50 Then
result = Application.WorksheetFunction.Sum(data1)
Else: result = Application.WorksheetFunction.Sum(data2)
End If

Range("B9").Value = result
End Sub

Regards
Peter
-----Original Message-----
Can Excel be used to write a program that evaluates a

list
of variables and controls the order of computations by
utilizing "IF ___, THEN ___, ELSE ___" and "GO TO ___"
statements. If so, how?
.

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
Open 2000 file attachments in Excel 2000 Judy[_2_] Excel Discussion (Misc queries) 2 September 20th 07 10:20 PM
I cannot edit cell format in Excel 2000 (Part of office 2000)! Brett Excel Discussion (Misc queries) 1 April 12th 06 05:58 PM
Using Excel 2000 as Data source for Word 2000 document Malcolm Agingwell Excel Discussion (Misc queries) 2 June 21st 05 09:28 AM
Hyperlink in Excel 2000 can't open bookmarked Word 2000 file DCheslock Excel Discussion (Misc queries) 1 May 5th 05 10:46 PM
Excel Programs developed in Office 2000 on Windows 2000 Trooper Excel Discussion (Misc queries) 4 March 12th 05 11:09 PM


All times are GMT +1. The time now is 09:46 AM.

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

About Us

"It's about Microsoft Excel"