Aug 1st, 2005, 12:45 AM
#1
Thread Starter
Junior Member
[RESOLVED]repeat forumla
hi all
if i need use the same formula for the same country how do i make it so that i do not copy and paste it again.like country "fra" and "aus" uses the same formula,how am i able to reduce the coding by not copying and paste the formula cause i having some country using the same forumla.
VB Code:
If c = "fra" Then
Select Case Application.Max(c.Offset(0, 1), c.Offset(0, 2))
Case 20 To 35
c.Offset(0, 4) = 20# * Application.Max(c.Offset(0, 1), c.Offset(0, 2))
Case 36 To 45
c.Offset(0, 4) = 20# * Application.Max(c.Offset(0, 1), c.Offset(0, 2))
Case Is > 100000
c.Offset(0, 4) = 5.5 * Application.Max(c.Offset(0, 1), c.Offset(0, 2))
Case Is > 1000
c.Offset(0, 4) = 6# * Application.Max(c.Offset(0, 1), c.Offset(0, 2))
Case Is > 300
c.Offset(0, 4) = 8# * Application.Max(c.Offset(0, 1), c.Offset(0, 2))
Case Is > 45
c.Offset(0, 4) = 10# * Application.Max(c.Offset(0, 1), c.Offset(0, 2))
Case Else
c.Offset(0, 4) = 100#
End Select
End If
VB Code:
If c = "aus" Then
Select Case Application.Max(c.Offset(0, 1), c.Offset(0, 2))
Case 20 To 35
c.Offset(0, 4) = 20# * Application.Max(c.Offset(0, 1), c.Offset(0, 2))
Case 36 To 45
c.Offset(0, 4) = 20# * Application.Max(c.Offset(0, 1), c.Offset(0, 2))
Case Is > 100000
c.Offset(0, 4) = 5.5 * Application.Max(c.Offset(0, 1), c.Offset(0, 2))
Case Is > 1000
c.Offset(0, 4) = 6# * Application.Max(c.Offset(0, 1), c.Offset(0, 2))
Case Is > 300
c.Offset(0, 4) = 8# * Application.Max(c.Offset(0, 1), c.Offset(0, 2))
Case Is > 45
c.Offset(0, 4) = 10# * Application.Max(c.Offset(0, 1), c.Offset(0, 2))
Case Else
c.Offset(0, 4) = 100#
End Select
End If
Attached Files
Last edited by surface; Aug 1st, 2005 at 10:58 AM .
Aug 1st, 2005, 04:25 AM
#2
Re: repeat forumla
Code:
if c="aus" or c="fra" Then
'---- your code here
end if
Only if they are the same and will stay the same.
Feeling like a fly on the inside of a closed window (Thunk!)
If I post a lot, it is because I am bored at work! ;D Or stuck...
* Anything I post can be only my opinion. Advice etc is up to you to persue...
Aug 1st, 2005, 10:56 AM
#3
Thread Starter
Junior Member
Re: repeat forumla
ok thx for the help
Posting Permissions
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
Forum Rules
Click Here to Expand Forum to Full Width