IsString?

nada

Board Regular
Joined
Jul 4, 2006
Messages
193
I have a macro that gets data from another program. I want to check that data and "clean" it ie remove unneccessay blanks etc. The data is stored in the variable BBAnswer. I then check that variable:

If IsRatingOK(BBAnswer) Then
.......

Function IsRatingOK(BBAnswer As Variant) As Boolean
IsRatingOK = False
Rating = CleanRating(BBAnswer)
.............................
End Function

Function CleanRating(BBAnswer As Variant) As String
c_pos = InStr(1, BBAnswer, " ", 1)
...............
on the last row I get an error if BBAnswer is not a string ie it has some other format. Please help me how to solve this problem. Is there anything like IsDate() or is there any other way of solving this? Please help! Any help appreciated! Thanks alot in advance!
 

Some videos you may like

Excel Facts

Easy bullets in Excel
If you have a numeric keypad, press Alt+7 on numeric keypad to type a bullet in Excel.

nada

Board Regular
Joined
Jul 4, 2006
Messages
193
hi! yes that seems to work. thanks!!!! is there any way to parse so that BBAnswer will always be a string?
 

Watch MrExcel Video

Forum statistics

Threads
1,114,407
Messages
5,547,771
Members
410,811
Latest member
adustin42
Top