Hi All,
This is my first post, so here goes:
Is there a VBA function similar to Evaluate that evaluates string inequalities as well? For example:
Str1 = "A"
Str2 = "B"
ineq = "<>"
How can I evaluate (Str1 & ineq & Str2)?
Hi All,
This is my first post, so here goes:
Is there a VBA function similar to Evaluate that evaluates string inequalities as well? For example:
Str1 = "A"
Str2 = "B"
ineq = "<>"
How can I evaluate (Str1 & ineq & Str2)?
Not sure what the utulity is:
![]()
Sub x() Dim s1 As String Dim s2 As String Dim sOpr As String s1 = "A" s2 = "B" sOpr = "=" MsgBox Evaluate("""" & s1 & """" & sOpr & """" & s2 & """") s2 = "A" MsgBox Evaluate("""" & s1 & """" & sOpr & """" & s2 & """") End Sub
Entia non sunt multiplicanda sine necessitate
Thanks a lot, I'll see if I can incorporate this.
I'm trying to write a function that concatenates a range of cells if they meet a certain criteria. I wanted to set it up that the syntax is like a SUMIF, where you can have inputs like "<2" or "ABC" as criteria. The Evaluate function worked well for the "<2", but I got stuck when that didn't work. If you have any suggestions, please let me know.
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks