View Single Post
  #7   Report Post  
Posted to microsoft.public.excel.programming
B Lynn B B Lynn B is offline
external usenet poster
 
Posts: 131
Default boolean variable?

Without being able to see the rest of your procedure, my guess would be
you've Dim'd myVar as Boolean, which means it can't hold a string, which is
what your inputbox returns. You would need a different variable to hold the
string and then test its value to see if you want to set myVar to True or
False.

"Steve" wrote:

Howdee all.
I have a macro that I've got a variable that presently requires either a
true, or false input.
This macro calls to another function, which only requires an input if the
element is true.
I'd like it to only require an input if the statement is true.

I just tried-

MyVar = Application.InputBox(Prompt:="Is this a font color?- True or False",
Type:=4)

If MyVar= "" Then
MyVar = False
Else: MyVar = True
End If

I receive a type mismatch error when I do this.