Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Convert XLM macro to VBA

Status
Not open for further replies.

JunglesMcBeef

Programmer
Sep 18, 2003
266
Hey All,

I have a simple XLM statement that has confused me for a while now, i can't understand it. Can someone please interpret this to VBA for me:
Code:
=IF(NOT(!FEM2>""))
I don't understand the !FEM2>"" side of it. I know that - !FEM is a reference to a cell, but I can't see how a numeric value can be greater than "" or how this conditional statement can even execute when the 2 comparison data types aren't the same.... Please help!!
 
I have this file already.... I know how IF statements work, how cell references work, and how the overall statement works...But if you read my question again it's more to do with the logic, less to do with syntax. How can a cell value be greater than ""? does it mean string length?
 
Another thing, how can I create an XLM macro? Do I need a copy of Excel 4.0?
 
Insert a Macro Sheet

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
Thanks for that.

In the end it logically worked out how I expected. If !FEM2 was nothing then it worked out true. Which I am guessing means that when a cell reference is used along with >"" in a conditional statement it means to check whether any data exists within the cell. So in reality the answer to my original post is:
Code:
=IF(NOT(!FEM2>""))
looks like this in VBA:
Code:
If Not fem2 > "" Then
Seems simple but XLM is a complete hassle, cheers.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top