ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Compare between String and Value using VBA (https://www.excelbanter.com/excel-programming/332974-compare-between-string-value-using-vba.html)

Coco

Compare between String and Value using VBA
 
What VBA function can I use to implement a conditional IF like this:

Dim myValue as string

If (string VALUE is TEXT) then
....
end if

if (string VALUE is VALUE) then
....
end if




examples:
string value can be like :
A1
ABC34
XYZ1234

string value as value (only numbers):
12
345
67

Thanks

Coco

Jim Thomlinson[_4_]

Compare between String and Value using VBA
 
Dim myValue as string

If isnumeric(myValue) then
....
end if

if not isnumeric(myValue) then
....
end if

--
HTH...

Jim Thomlinson


"coco" wrote:

What VBA function can I use to implement a conditional IF like this:

Dim myValue as string

If (string VALUE is TEXT) then
...
end if

if (string VALUE is VALUE) then
...
end if




examples:
string value can be like :
A1
ABC34
XYZ1234

string value as value (only numbers):
12
345
67

Thanks

Coco



All times are GMT +1. The time now is 08:35 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com