I haven't tried this; but what about something like:

v = SelectColour(1)

Private Function SelectColour(ByVal value As Integer) As String
Dim colour As String = "Black"
    Select Case value
        Case 1
          colour = "Red"
        Case 2
           colour = "Orange"
        Case Else
           colour = "Grey
    End Select
Return colour
End Function

On Feb 18, 12:36 pm, Robin <[email protected]> wrote:
> Hey,
>
> I'm currently creating a report for Microsoft Project Server in Visual
> Studio.
> Everything is going great so far, but i'm currently stuck at dynamic
> styles.
>
> I would like a certain cell to have a color based on the value.
> I know this is possible with 2 different values, like this:
>
> =iif(Fields!Profit.Value < 0, "Red", "Black")
> (http://msdn.microsoft.com/en-us/library/ms252080.aspx)
>
> But what if i would also like an Orange for the value 1? I was
> thinking of something like a switch or elseif, but that's not working
> (im not very experienced in VB!)
>
> Thanks!

Reply via email to