Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
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. |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
IsString
maybe you used
set r = activecell.Range application.IsText(r) or if vartype(r) = vbString or typename(r.value) = "String" there is an Isnumeric, but that checks if the variable can be evaluated or treated as a number - it could be stored as a string. -- Regards, Tom Ogilvy "Ian Parker" wrote: 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. |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
IsString
Ian,
Perhaps? If Application.IsText(yourValue) Then MsgBox "That was a string" Else MsgBox "That wasn't a string" End If HTH, Bernie MS Excel MVP "Ian Parker" wrote in message .com... 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. |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
IsString
Thank you all for replying. You all mention 'Application.IsText' . When
I try this out my version of Excel/BA 2003 does not seem to have this function. Do I have to add some specific DLL to load the IsText functionality? I am very grateful for people helping me out as I have limited access to written information. My situation is that I have just got a record set via a SQL query. I need to test if the 3rd element in the record set is a string so that I may process it correctly or tell the user of the macro that the database might be corrupt. Ian Bernie Deitrick wrote: Ian, Perhaps? If Application.IsText(yourValue) Then MsgBox "That was a string" Else MsgBox "That wasn't a string" End If HTH, Bernie MS Excel MVP "Ian Parker" wrote in message .com... 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. |
#5
Posted to microsoft.public.excel.programming
|
|||
|
|||
IsString
Thank you Tom
vartype(r) = vbString works for me. I am very grateful. Ian |
#6
Posted to microsoft.public.excel.programming
|
|||
|
|||
IsString
istext is a worksheet function
go into a cell and type =istext(A1) Perhaps you are looking at intellisense or the object browser to say you don't have it rather than just trying it. It is certainly available. In the object browser you would see it under the Worksheetfunction object. so you can do (? is for use in the immediate window) ? application.WorksheetFunction.IsText(r) or ? WorksheetFunction.IsText(r) or ? Application.IsText(r) -- Regards, Tom Ogilvy wrote in message oups.com... Thank you all for replying. You all mention 'Application.IsText' . When I try this out my version of Excel/BA 2003 does not seem to have this function. Do I have to add some specific DLL to load the IsText functionality? I am very grateful for people helping me out as I have limited access to written information. My situation is that I have just got a record set via a SQL query. I need to test if the 3rd element in the record set is a string so that I may process it correctly or tell the user of the macro that the database might be corrupt. Ian Bernie Deitrick wrote: Ian, Perhaps? If Application.IsText(yourValue) Then MsgBox "That was a string" Else MsgBox "That wasn't a string" End If HTH, Bernie MS Excel MVP "Ian Parker" wrote in message .com... 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. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|