View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
Dave Peterson Dave Peterson is offline
external usenet poster
 
Posts: 35,218
Default boolean variable?

How about just making sure that the variable is declared as a boolean:

Dim myVar As Boolean
myVar = Application.InputBox(Prompt:="Is this a font color?- True or False", _
Type:=4)
msgbox myVar






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.


--

Dave Peterson