VBA Info

  • Thread starter Thread starter LT
  • Start date Start date
L

LT

Hi everyone. Somehow I think I should know this but the answer is
just not stepping up.

In Excel for example I know to use this formula for finding out if a
cell has data in it. =IF(F18<>"","Yes","No")

What is the syntax for doing this VBA?

if cboDepartment (HAS a value) then do this, otherwise do this.

Thanks in advance!

-LT
 
Hi LT,

One way:

If Not IsEmpty(Range("A1")) Then
;do something
End If
 
Sub Macro1()
If cboDepartment.Value = "" Then
MsgBox "Has no Value Exit Macro..."
Exit Sub
Else
MsgBox "Has Value Run Macro..."
End If

End Sub
 
Hi LT,

One way:

If Not IsEmpty(Range("A1")) Then
;do something
End If

---
Regards,
Norman











- Show quoted text -

Thanks for the reply Mike and Norman! Much appreciated!
-LT
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top