can someone convert that to case statement:

Private Function Discount(curr As Currency) As Currency
    Dim temp As Currency
    
    If curr < 15 Then
        temp = 0
    ElseIf (curr > 14.99) And (curr < 30) Then
        temp = 0.05
    ElseIf (curr > 29.99) Then
        temp = 0.1
    End If
    
    Discount = curr - (curr * temp)
        
End Function

Recommended Answers

All 2 Replies

Lets see what you have tried... and if you have no idea, I'll give you a hint

Select Case Curr

Good Luck

Private Function Discount(curr As Currency) As Currency

Dim temp As Currency 
    
Select Case curr

    case is < 15
        temp = 0
    case 15 to 30
        temp = 0.05
    case is > 30
	temp = 0.1

End Select

    
Discount = curr - (curr * temp)
        
End Function
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.