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

Hi guys and galls,

Question 1:

I know how to read what kind of ASCII is standing in a cell ( Example:
6 is 54 and z is 90) but what if I want it the other way around,
displaying the leter with the code 86 for example.

Question 2:

And what if I want to read a multiple filled cell. A cell with for
example VW as Value?

Question 3:

Can I rip the contens of the cell apart and check if the Carathers used
in a cell are for example letters ( like ASCII between 65 and 90)

Please
help!!!!.1.!!!!!!!1!1.11.1!1!.1111.1!!!!!! 1.!!111!.....1.1.!!!!1.111!!!!!!


---
Message posted from http://www.ExcelForum.com/

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 860
Default Ascii

Hi Syrus,

Answers inline....

Question 1:
I know how to read what kind of ASCII is standing in a cell ( Example:
6 is 54 and z is 90) but what if I want it the other way around,
displaying the leter with the code 86 for example.


Use the Chr$() function instead of the Asc() function. If you select Asc in
your code and hit F1, you will be taken to the help for the Asc function.
From there, you can click See Also and read the help on Chr.

Question 2:
And what if I want to read a multiple filled cell. A cell with for
example VW as Value?


For this one, you can read the entire string into a variable and step
through it with a loop:

Sub test2()
Dim s As String
Dim n As Integer

s = Sheet1.Range("A1").Text
For n = 1 To Len(s)
MsgBox Asc(Mid$(s, n, 1))
Next n
End Sub

Question 3:
Can I rip the contens of the cell apart and check if the Carathers
used in a cell are for example letters ( like ASCII between 65 and 90)


Sub test3()
Dim s As String
Dim n As Integer
Dim nCode As Integer
Dim bBadData As Boolean

s = Sheet1.Range("A1").Text
For n = 1 To Len(s)
nCode = Asc(Mid$(s, n, 1))
If nCode < 65 Or (nCode 90 And (nCode < 97 _
Or nCode 122)) Then
bBadData = True
Exit For
End If
Next n

If bBadData Then MsgBox ("Invalid character(s)")
End Sub

--
Regards,

Jake Marx
MS MVP - Excel
www.longhead.com

[please keep replies in the newsgroup - email address unmonitored]

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,327
Default Ascii

1
=CHAR(86)
or
=CHAR(A1)
with 86 in cell A1
2+3
You'd need a macro for that I think.
--
HTH. Best wishes Harald
Followup to newsgroup only please

"Syrus the Virus " skrev i
melding ...
Hi guys and galls,

Question 1:

I know how to read what kind of ASCII is standing in a cell ( Example:
6 is 54 and z is 90) but what if I want it the other way around,
displaying the leter with the code 86 for example.

Question 2:

And what if I want to read a multiple filled cell. A cell with for
example VW as Value?

Question 3:

Can I rip the contens of the cell apart and check if the Carathers used
in a cell are for example letters ( like ASCII between 65 and 90)

Please

help!!!!.1.!!!!!!!1!1.11.1!1!.1111.1!!!!!! 1.!!111!.....1.1.!!
!!1.111!!!!!!


---
Message posted from http://www.ExcelForum.com/



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7,247
Default Ascii

You can use the Chr function to get the character corresponding
to an Ascii value. For example, Chr(65) will return an 'A'
character as a string.

You can loop through the characters in a string, ensuring that
each character is an uppercase letter. E.g.,

Dim S As String
Dim C As String
Dim N As Long

S = Range("A1").Text
For N = 1 To Len(S)
C = Mid(S, N, 1)
If Asc(C) = 65 And Asc(C) <= 90 Then
' upper case character
Else
' not an upper case character
End If
Next N


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com


"Syrus the Virus "
wrote in message
...
Hi guys and galls,

Question 1:

I know how to read what kind of ASCII is standing in a cell (

Example:
6 is 54 and z is 90) but what if I want it the other way

around,
displaying the leter with the code 86 for example.

Question 2:

And what if I want to read a multiple filled cell. A cell with

for
example VW as Value?

Question 3:

Can I rip the contens of the cell apart and check if the

Carathers used
in a cell are for example letters ( like ASCII between 65 and

90)

Please

help!!!!.1.!!!!!!!1!1.11.1!1!.1111.1!!!!!! 1.!!111!..
....1.1.!!!!1.111!!!!!!


---
Message posted from http://www.ExcelForum.com/



  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Ascii

Tnxs for you're quick responce..........

--
Message posted from http://www.ExcelForum.com

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
CSV to ASCII Quco Excel Discussion (Misc queries) 5 April 4th 23 10:30 AM
Ascii in a cell Mr Doggo Excel Discussion (Misc queries) 4 September 3rd 06 12:16 AM
ASCII files ...please help riggi Excel Discussion (Misc queries) 5 June 27th 06 04:25 AM
importing ASCII tt Excel Discussion (Misc queries) 1 March 3rd 06 03:29 AM
ASCII value Terence Excel Programming 2 October 2nd 03 03:41 AM


All times are GMT +1. The time now is 12:51 AM.

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"