Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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? |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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? . |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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? . . |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
if (Var1 = x or var2 = y ) and not (var2 = " ") then
-- Regards, Tom Ogilvy "Don" wrote in 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? |
#5
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Typo: (should be)
if (Var1 = x or var1 = y ) and not (var2 = " ") then -- Regards, Tom Ogilvy "Tom Ogilvy" wrote in message ... if (Var1 = x or var2 = y ) and not (var2 = " ") then -- Regards, Tom Ogilvy "Don" wrote in 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? |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Change Macro to Find First Empty Cell | Excel Discussion (Misc queries) | |||
Macro code for dropping to next empty cell | Excel Discussion (Misc queries) | |||
Getting a macro to see the next available empty cell | Excel Discussion (Misc queries) | |||
macro to look for empty cell | Excel Discussion (Misc queries) | |||
if cell empty hide row macro? | Excel Programming |