ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Quick If Question (https://www.excelbanter.com/excel-programming/301526-quick-if-question.html)

RPIJG[_47_]

Quick If Question
 
I just want to have an If statement so that...
If textbox1 is empty to do nothing, if Textbox one has a value you i
it, then run the code

--
Message posted from http://www.ExcelForum.com


Ed[_18_]

Quick If Question
 
Not sure what you mean by
if Textbox one has a value you in it


If you mean "If Textbox1 is not empty", then
If Textbox1.Text < "" Then
' your code here
End If

If you mean Textbox1 has a specific word or string in it, then
If Textbox1.Text = "yourstringhere" Then
' your code here
End If

In both cases, if Textbox1.Text is empty, the If will be bypassed. If you
want to do something if it's empty, then in either If, put
' your code here
Else:
' other code if empty
End If

HTH
Ed

"RPIJG " wrote in message
...
I just want to have an If statement so that...
If textbox1 is empty to do nothing, if Textbox one has a value you in
it, then run the code.


---
Message posted from http://www.ExcelForum.com/





All times are GMT +1. The time now is 09:20 PM.

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