Free Microsoft Excel 2013 Quick Reference

IsString

I have used the VBA function IsString in the past and I do not remember
any problems. I have upgraded to Office 2003 and suddenly I can not test
if a member of a record set is a string. Please tell me if there is a new
or another old way that still works.

There seems to be a IsNum but no IsString.


Hi,

Hopefully this is easy:

I have an array of variants..


	VB:
	
lvarArrSource = Array(12, "=F", 2, 3, 4, 5, 11, 6, 7, 8, 9, 10, "123", "F", "F", "F", "F", 11, "F", "NR", "F") 

If you like these VB formatting tags please consider sponsoring the author in support of injured Royal Marines
which i am using to map columns between spreadsheets.

The basic numeric entries refer to columns to copy. But I want to make the routine smarter with the strings.

Basically I want the program to:

	VB:
	
 
    Do something 
    End If 
    If left(array(x),1) = "=" Then 
        Do something Else 
        End If 
        If array(x) Is String literal (e.g "xyz" Or "123") Then 
            Do a third thing 
            End If 

If you like these VB formatting tags please consider sponsoring the author in support of injured Royal Marines
i cant find a typeof or isstring kind of function.
Isnumeric works ok for some values but quoted numbers (eg "123") return true (which isnt what i want).
I have tried the left(string,1) = """ but excel seems to hide the quotes.

Any ideas?

Hi Ozgrid,

in some of my excel macros, I need to take values from certain cells and perform various operations on them, pretty standard huh?

anyway, what I'm not sure how to do, is make it full proof against dumb users. so my question is, if there is a way to check if a value in a cell is perhaps, an integer, or a double, or a string.

I would assume VBA has some of these functions built in.

something like, isString(Cells(x,x).value), that would return true or false if the entry in that cell is a string, and analagous ones for different types of numbers and things like that.

thanks for any help.