Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

TYPE function 1

Status
Not open for further replies.

Luis939

MIS
Feb 28, 2003
453
US
im having problems using the TYPE function, i went to the help file to see how to use it but i keep getting errors
Cant i use
If TYPE(activecell.value) = 2 then.......

what is the proper syntax to determine whether my value is a string or not?? thanks!
 
Here is one way:
[blue]
Code:
  Sub test()
    If TypeName(ActiveCell.Value) = "String" Then
      MsgBox "Is a string"
    Else
      MsgBox "NOT a string"
    End If
  End Sub
[/color]

 
Yea Zanthras I went back to the help function, saw the topic on TypeName, and tested it, and it worked, i wonder why it said TYpe would do that and it didnt help me. Thanks alot though, your always a great help!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top