#1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 29
Default Calculation

Under the condition, if

A1=0 and A2 = 1-1/2, then B1 = Good
A1=0 and A2 = 2-3/4, then B1 = Excellent
A1=0 and A2 2-3/4, then B1 = Superb

A3=0 and A4 = 1-1/2, then B3 = Good
A3=0 and A4 = 2-3/4, then B3= Excellent
A3=0 and A4 2-3/4, then B3= Superb,
and so on€¦

I would like to do it by VBA, could someone please help.

  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 4,624
Default Calculation

One way:

Dim rCell As Range
For Each rCell In Range("A1,A3")
With rCell
If .Value = 0 Then
Select Case .Offset(1, 0).Value
Case Is = 1.5
.Offset(0, 1).Value = "Good"
Case Is = 2.75
.Offset(0, 1).Value = "Excellent"
Case Is 2.75
.Offset(0, 1).Value = "Superb"
Case Else
.Offset(0, 1).ClearContents
End Select
End If
End With
Next rCell

In article ,
AlanW wrote:

Under the condition, if

A1=0 and A2 = 1-1/2, then B1 = Good
A1=0 and A2 = 2-3/4, then B1 = Excellent
A1=0 and A2 2-3/4, then B1 = Superb

A3=0 and A4 = 1-1/2, then B3 = Good
A3=0 and A4 = 2-3/4, then B3= Excellent
A3=0 and A4 2-3/4, then B3= Superb,
and so on€¦

I would like to do it by VBA, could someone please help.

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
Calculation Bill Ridgeway Excel Discussion (Misc queries) 5 July 2nd 07 01:17 PM
Age calculation Clash Excel Discussion (Misc queries) 5 March 17th 06 07:16 PM
calculation ss Excel Discussion (Misc queries) 2 November 8th 05 08:51 PM
How do I use a rounded calculation result in another calculation? vnsrod2000 Excel Worksheet Functions 1 January 26th 05 10:11 PM
How do I use a rounded calculation result in another calculation? vnsrod2000 Excel Worksheet Functions 1 January 26th 05 09:36 PM


All times are GMT +1. The time now is 12:13 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"