Hi there
I have a drop down in cell which can be a blank or text.
Now i want to declare a variable in macro that should be equal to this cell text (if this drop down cell has text) or variable can be any text value.
As long as this cell has value , macro runs fine but when this cell is blank, then how do i tell macro that when it is blank, this variable can be any other text value.
I have tried like below
Dim zz as string
if Range("b2")<>"" then
zz=range("b2").value
else
zz="*"
end if
But above does not help as then it takes zz value as * but i want to it be any text string.
I have a drop down in cell which can be a blank or text.
Now i want to declare a variable in macro that should be equal to this cell text (if this drop down cell has text) or variable can be any text value.
As long as this cell has value , macro runs fine but when this cell is blank, then how do i tell macro that when it is blank, this variable can be any other text value.
I have tried like below
Dim zz as string
if Range("b2")<>"" then
zz=range("b2").value
else
zz="*"
end if
But above does not help as then it takes zz value as * but i want to it be any text string.