Hi everyone,
I have a VBA code that makes a function to evaluate the string in a cell as a function itself. It looks like this:
Function Evalu(ByVal S As String) As String
Evalu = Evaluate(S)
End Function
The idea is that the user can write a term like "sports" into one cell (A2) in a different sheet, and then using a bunch of concatenate formulas, it writes a code like this:
=CONCATENATE("IF(SUM(COUNTIF($B3,{"&A2&"}))>0,1,0))"
So that in the end, the concatenated string is searching another cell to see if it contains "sports". The idea is that this is done for a bunch of rows, so that I can label all the rows 0 or 1, to determine if they contain "sports".
However, if you write something different into A2, like "movies", I have to manually go back and auto fill the column that uses my eval function to relabel all my rows 0 or 1 according to "movies" now. Is there some way I can set it to automatically update the column where my VBA EVAL function is running? If possible, I'd like to do for just that column, since rebuilding the entire worksheet is quite time consuming.
Thanks everyone!
I have a VBA code that makes a function to evaluate the string in a cell as a function itself. It looks like this:
Function Evalu(ByVal S As String) As String
Evalu = Evaluate(S)
End Function
The idea is that the user can write a term like "sports" into one cell (A2) in a different sheet, and then using a bunch of concatenate formulas, it writes a code like this:
=CONCATENATE("IF(SUM(COUNTIF($B3,{"&A2&"}))>0,1,0))"
So that in the end, the concatenated string is searching another cell to see if it contains "sports". The idea is that this is done for a bunch of rows, so that I can label all the rows 0 or 1, to determine if they contain "sports".
However, if you write something different into A2, like "movies", I have to manually go back and auto fill the column that uses my eval function to relabel all my rows 0 or 1 according to "movies" now. Is there some way I can set it to automatically update the column where my VBA EVAL function is running? If possible, I'd like to do for just that column, since rebuilding the entire worksheet is quite time consuming.
Thanks everyone!