LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default How do I use VBA or a function to do a certain type of string work

Hi christopher ward:

i would do this:

Dim linea As Integer
linea = 2
do while <YourWorksheet.cells(linea,1).value <""
if (((chr(left(<YourWorksheet.cells(linea,1).value,1 ))=48) and
(chr(left(<YourWorksheet.cells(linea,1).value,1)) <=57))or
((chr(left(<YourWorksheet.cells(linea,1).value,1) )=65)and
(chr(left(<YourWorksheet.cells(linea,1).value,1)) =90))or
((chr(left(<YourWorksheet.cells(linea,1).value,1) )=97)and
(chr(left(<YourWorksheet.cells(linea,1).value,1)) =122)))=true then
do what you want
End If
linea = linea + 1
Loop

this code check if the firt character is a 1-9, a-z, A-Z, and do something,
add an else sentence to do other things if the first character is a symbol.

I hope this would helpful for you, please let me know,
Bye!
 
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
range or string or long type bartman1980 Excel Programming 15 November 8th 07 05:12 PM
Determine data type in a string news.epix.net Excel Programming 5 October 31st 07 01:56 PM
Can I evaluate a function parameter(string type) as VBA souce code Evaluate function parameter as VBA code Excel Programming 7 July 22nd 07 11:54 PM
testing for a string type 6e Excel Programming 1 July 20th 06 06:02 PM
Type mismatch? string 2 a long?? CAA[_2_] Excel Programming 4 December 9th 03 02:34 PM


All times are GMT +1. The time now is 02:49 AM.

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

About Us

"It's about Microsoft Excel"