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!
 

Excel Facts

Format cells as currency
Select range and press Ctrl+Shift+4 to format cells as currency. (Shift 4 is the $ sign).
hi! yes that seems to work. thanks!!!! is there any way to parse so that BBAnswer will always be a string?
 
Upvote 0

Forum statistics

Threads
1,215,025
Messages
6,122,731
Members
449,093
Latest member
Mnur

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top