puriwutpokin wrote: Tue Apr 17, 2018 4:38 pm
คำถามเกี่ยว VBA ตามกฏของบอร์ดนี้ ต้องเขียนมาก่อนครับ ติดขัดตรงไหน มาถามต่อครับ เบื้องต้นลองศึกษาจาก Google หรือ You Tube แล้วติดตรงไหนมาถามกันในบอร์ดนี้ครับ
Option Explicit
Function Shippingprice(S) As String
Dim W As String
Dim P As String
if P<=500 && W<=1.00
then S = "205"
else if P<=1000 and W<=1.00
thenS = "266"
else if P<=1500 and W<=1.00
thenS = "327"
else if P<=2000 and W<=1.00
thenS = "388"
else if P<=2500 and W<=1.00
thenS = "450"
else if P<=3000 and W<=1.00
thenS = "511"
else if P<=3500 and W<=1.00
thenS = "572"
else if P<=4000 and W<=1.00
thenS = "634"
else if P<=4500 and W<=1.00
thenS = "695"
else if P<=5000 and W<=1.00
thenS = "756"
else if P<=5500 and W<=1.00
thenS = "817"
else if P<=6000 and W<=1.00
thenS = "879"
else if P<=6500 and W<=1.00
thenS = "940"
else if P<=7000 and W<=1.00
thenS = "1001"
else if P<=7500 and W<=1.00
thenS = "1062"
else if P<=8000 and W<=1.00
thenS = "1124"
else if P<=8500 and W<=1.00
thenS = "1185"
else if P<=9000 and W<=1.00
thenS = "1246"
else if P<=9500 and W<=1.00
thenS = "1307"
else if P<=10000 and W<=1.00
thenS = "1369"
End If
End Function
ประมานนี้ครับ