View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
Kris Kris is offline
external usenet poster
 
Posts: 25
Default Need help with empty cell in Macro

Not quite.

1) IsEmpty is a function. So the correct use of a
function would be something more like:

If Not IsEmpty(var2)

2) IsEmpty returns True if the variable has not been
initialized, not if the variable is blank. And there is
a difference between the two. The following example
illustrates this:

Dim var1 As String
Dim var2

If IsEmpty(var1) Then
MsgBox "Var1 is Empty"
End If

If IsEmpty(var2) Then
MsgBox "Var2 is Empty"
End If


Sincerely,

Kris

-----Original Message-----
hi,
if var1 = "x" or var1 = "y" and var2 not isempty then

-----Original Message-----
set var2 in macro that returns " " when cell is

empty.
Need statement that says If var1 = x or var1 = y and
var2 not " " Then

Can anyone help?
.

.