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 .
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