Visio Guy

Visio Discussions => ShapeSheet & Smart Shapes => Topic started by: Gustavo on November 08, 2017, 07:45:00 PM

Title: Replace text string to a respective negative number in Prop cell
Post by: Gustavo on November 08, 2017, 07:45:00 PM
I want to replace the value of negative numbers that were input as a text in the form "(-)X.XX", in a property cell on a bunch of shapes. So I've changed the Property Cell type from 0 to 2, and used the REPLACE function to get rid of the parenthesis in an User cell, then evaluate if the result is less than 0, to rewrite the value in the Property cell to be changed, but the REPLACE function doesn't recognize the quotation marks, so it returns a "-X.XX" text string, so still is read as a text.

Any ideas on how to come around with this? Any help appreciated. Thank you.
Title: Re: Replace text string to a respective negative number in Prop cell
Post by: wapperdude on November 09, 2017, 02:29:56 AM
Assuming that your prop row, for this example, is Prop.R1, and an entry:  "(-)1.2".  Try this....I placed this formula in a User defined cell:  =REPLACE(REPLACE(Prop.R1,1,1,),2,1,).

The result stripped off the quotes, (, and ).  It leaves the minus sign and number:  -1.2.  I was able to do an arithmetic operation on the resultant number.

Wapperdude
Title: Re: Replace text string to a respective negative number in Prop cell
Post by: Gustavo on November 13, 2017, 11:19:48 PM
Thank you wapperdude. It worked as you described. Regards!