ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   In Excel need macro to tell if Text Box is Blank or has Text (https://www.excelbanter.com/excel-discussion-misc-queries/47439-excel-need-macro-tell-if-text-box-blank-has-text.html)

Jerry Dyben

In Excel need macro to tell if Text Box is Blank or has Text
 
In Excel I need a macro to tell me if the Text Box Number is Blank or has
Text in it.

Dave Peterson

Textboxes on the worksheet?

'if from the control toolbox toolbar
MsgBox Len(Worksheets("sheet1").TextBox1.Value)

'if from the Drawing toolbar
MsgBox Len(Worksheets("sheet1").TextBoxes("Text box 2").Text)

You could just look to see if it was equal to "", too.



Jerry Dyben wrote:

In Excel I need a macro to tell me if the Text Box Number is Blank or has
Text in it.


--

Dave Peterson


All times are GMT +1. The time now is 01:13 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com