I am trying to add a + sign in front of certain variables if they are positive. ex:
Sub mySub()
Dim cash As Variant
End Sub
It works well if I do:
Dim plus As String
plus = "+"
If cash > 0 Then
cash = plus & cash
Else
cash= cash
End If
But I was looking for a sub or function that would take all my variables and add a + sign in front of them if they are positive.
sub NewSub(i As Variant)
If i > 0 Then
i = plus & i
Else
i = i
End If
End sub
But it doesn't seem to work as it doesn't show me anything (I then display my variables in a cell in excel). And a function doesn't work either.
Any ideas on how to create a sub/function to do that? Can I loop through my variables in any way ?