#1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 244
Default Is string

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!

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10,593
Default Is string

I cannot reproduce the problem. What is in BBAnswer that causes your
problem?

--
HTH

Bob Phillips

(replace somewhere in email address with gmail if mailing direct)

"Arne Hegefors" wrote in message
...
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!



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Change 3 letter text string to a number string Pete Excel Discussion (Misc queries) 3 December 31st 07 07:47 PM
Importing Long String - String Manipulation (INVRPT) (EDI EANCOM 96a) Brian Excel Programming 3 February 9th 06 03:38 PM
Importing Long String - String Manipulation (EDI EANCOM 96a) Brian Excel Programming 6 February 9th 06 12:27 PM
to search for a string and affect data if it finds the string? Shwaman Excel Worksheet Functions 1 January 11th 06 12:56 AM
Create a formula into a String then assign string to a cell Myrna Larson[_2_] Excel Programming 6 August 23rd 03 09:42 PM


All times are GMT +1. The time now is 10:57 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"