Author Topic: Let the box height be 0 if it does not have any text  (Read 237 times)

0 Members and 1 Guest are viewing this topic.

SB.visguy

  • Newbie
  • *
  • Posts: 2
Let the box height be 0 if it does not have any text
« on: April 13, 2019, 05:09:18 AM »
Hello everyone,

I'm doing a table in Visio in such a way that if there is no text entered in the cell of a table, the box will disappear, so its height will be 0. But non of the if functions are working

I have tried entering the following functions in the shapesheet height, but none is working.
=if(len(thetext)=0,0,5mm). So that if there is no text, the height will be 0, else, its 5mm. But its not working

I have also tried
 =if(thetext="",0,5mm) but it is not working too.

If anyone has a different approach or a fix for the functions that I have entered, thank you!

Paul Herber

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 2746
    • Paul Herber's website
Re: Let the box height be 0 if it does not have any text
« Reply #1 on: April 13, 2019, 05:32:02 AM »
Try:
IF(TEXTWIDTH(TheText)<3mm, 0mm, 5mm)

The size of the text includes the size of the text box margins.
Electronic and Electrical engineering, business and software stencils and applications for Visio -

http://www.paulherber.co.uk/

SB.visguy

  • Newbie
  • *
  • Posts: 2
Re: Let the box height be 0 if it does not have any text
« Reply #2 on: April 13, 2019, 06:25:13 AM »
Thank you! it worked!

Paul Herber

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 2746
    • Paul Herber's website
Re: Let the box height be 0 if it does not have any text
« Reply #3 on: April 13, 2019, 06:28:04 AM »
It might not be the best solution ...
Electronic and Electrical engineering, business and software stencils and applications for Visio -

http://www.paulherber.co.uk/