|
-
Apr 24th, 2007, 01:02 AM
#1
Thread Starter
Member
[RESOLVED] How to differentiate bet a number and a character ??
Hey guys!
I wanted to know if there is a ISNUM kind of a command which can be used to differentiate between a number and a character..
Actually, i will be having two kinds of STRINGS in excel.
1) \\<Characters>\\ example: \\DELCHARNUM\\
2) \\<Numbers>\\ example: \\1\\
Now depending on wheather the string is of the first type or the second, ill have to carry out certain actions.. so i just wanted to know how i could differentiate bet the two kinds of Strings shown above..
Cheers
Abhilash
-
Apr 24th, 2007, 01:35 AM
#2
Re: How to differentiate bet a number and a character ??
A good exercise for the Heart is to bend down and help another up...
Please Mark your Thread " Resolved", if the query is solved
MyGear:
★ CPU ★ Ryzen 5 5800X
★ GPU ★ NVIDIA GeForce RTX 3080 TI Founder Edition
★ RAM ★ G. Skill Trident Z RGB 32GB 3600MHz
★ MB ★ ASUS TUF GAMING X570 (WI-FI) ATX Gaming
★ Storage ★ SSD SB-ROCKET-1TB + SEAGATE 2TB Barracuda IHD
★ Cooling ★ NOCTUA NH-D15 CHROMAX BLACK 140mm + 10 of Noctua NF-F12 PWM
★ PSU ★ ANTEC HCG-1000-EXTREME 1000 Watt 80 Plus Gold Fully Modular PSU
★ Case ★ LIAN LI PC-O11 DYNAMIC XL ROG (BLACK) (G99.O11DXL-X)
★ Monitor ★ LG Ultragear 27" 240Hz Gaming Monitor
★ Keyboard ★ TVS Electronics Gold Keyboard
★ Mouse ★ Logitech G502 Hero
-
Apr 24th, 2007, 02:19 AM
#3
Thread Starter
Member
Re: How to differentiate bet a number and a character ??
hey sid!
that thread did help.. as in i found bout the IsNumeric func. that shd solve my prob but another thing i require is to get to the number or the character..
I say that because.. in the excel sheet, there can be normal character strings which have to be treated separately and then there will be strings starting wid 2 backslashes ( \\ ).
So basically, i first have to chk for the 2 backslashes and then chk if the next character after the 2 backslashes is a number or a character.
I can use the IsNumeric once i have gone past the 2 backslashes.. but i dun rilli know how to do dat...
Please advise
cheers
Abhilash
-
Apr 24th, 2007, 04:13 AM
#4
Re: How to differentiate bet a number and a character ??
once i have gone past the 2 backslashes.. but i dun rilli know how to do dat...
Then the MID or the INSTR function will help you.
Try them...
here is a quick example. Edit it as per your needs.
vb Code:
Private Sub CommandButton1_Click()
strng = "//1//"
'or strng = "ads/as//2//sdfa"
For i = 1 To Len(strng)
If Mid(strng, i, 2) = "//" Then
Count = i + 2
Exit For
End If
Next i
If IsNumeric(Mid(strng, Count, 1)) = True Then
MsgBox Mid(strng, Count, 1) & " is a number"
End If
End Sub
Last edited by Siddharth Rout; Apr 24th, 2007 at 04:23 AM.
A good exercise for the Heart is to bend down and help another up...
Please Mark your Thread " Resolved", if the query is solved
MyGear:
★ CPU ★ Ryzen 5 5800X
★ GPU ★ NVIDIA GeForce RTX 3080 TI Founder Edition
★ RAM ★ G. Skill Trident Z RGB 32GB 3600MHz
★ MB ★ ASUS TUF GAMING X570 (WI-FI) ATX Gaming
★ Storage ★ SSD SB-ROCKET-1TB + SEAGATE 2TB Barracuda IHD
★ Cooling ★ NOCTUA NH-D15 CHROMAX BLACK 140mm + 10 of Noctua NF-F12 PWM
★ PSU ★ ANTEC HCG-1000-EXTREME 1000 Watt 80 Plus Gold Fully Modular PSU
★ Case ★ LIAN LI PC-O11 DYNAMIC XL ROG (BLACK) (G99.O11DXL-X)
★ Monitor ★ LG Ultragear 27" 240Hz Gaming Monitor
★ Keyboard ★ TVS Electronics Gold Keyboard
★ Mouse ★ Logitech G502 Hero
-
Apr 25th, 2007, 12:21 AM
#5
Thread Starter
Member
Re: How to differentiate bet a number and a character ??
Hey Koolsid!!
This looks like wad i need.. thx
cheers
Abhilash
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|