Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

If J 6 is selected, the following code checks if the value in J 1 2 is 0 - 3 3 0 , if so

If J6 is selected, the following code checks if the value in J12 is 0-330, if so, it populates S1 in J18 and divides the value in J14 by 360. If the value in J12 is 331-500, it populates S1 in J18 and it divides the value in J14 by 240. If the value in J12 is 500-600, it populates S2 in J18 and it divides the value in J14 by 180. If the value in J12 is 661-1000, it populated S2 in J18.
If cs.Range("J6")="DC" Then
If cs.Range("J12")>=0 And cs.Range("J12")<=330 Then
cs.Range("J18")="S1"
cs.Range("J20")= Application.WorksheetFunction.Ceiling(cs.Range("J14")/360,1)
ElseIf cs.Range("J12")>=331 And cs.Range("J12")<=500 Then
cs.Range("J18")="S1"
cs.Range("J20")= Application.WorksheetFunction.Ceiling(cs.Range("J14")/240,1)
ElseIf cs.Range("J12")>=500 And cs.Range("J12")<=660 Then
cs.Range("J18")="S2"
cs.Range("J20")= Application.WorksheetFunction.Ceiling(cs.Range("J14")/180,1)
ElseIf cs.Range("J12")>=661 And cs.Range("J12")<=1000 Then
cs.Range("J18")="S2"
cs.Range("J20")= Application.WorksheetFunction.Ceiling(cs.Range("J14")/120,1)
End If
Edit the code to implement the following
For S1:
If value in J12 is 0-330 and if J12 times J14 is more than 120000 then divide J14 by 360. If value in J12 is 331-500 if J12 times J14 is more than 120000 the divide J14 by 240. Otherwise, if J12 times J14 is than less than 120000 divide J14 by 360.
For S2:
If value in J12 is 500-660 and if J12 times J14 is more than 120000 then divide J14 by 180. If value in J12 is 661-1000 if J12 time J14 is more than 120000 the divide J14 by 120. Otherwise, if J12 times J14 is than less than 120000 divide J14 by 180.

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Master The Art Of Data Storytelling With Visualizations

Authors: Alexander N Donovan

1st Edition

B0CNMD9QRD, 979-8867864248

More Books

Students also viewed these Databases questions