Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 325
Default VBA code to enter extended characters onto a worksheet

Can anyone help me with a way to enter extended characters into a worksheet.

I can record myeslf entering something like <<ALT+0166 into a cell, but
the recorder shows the actual character, and not the keystroke sequence.

The reason I want to be able to do this is that I want to be able to write a
loop that enters all the characters in a character set into successive cells
in the worksheet thus:

For Counter=1 to 255
selection.formula= (whatever the answer is to this question) e.g.
ALT+0156
selection.offset(1,0).select
Next Counter

then formats them in a particular font, to produce and print character maps
for all characters in that font.

Not life-threatening, I know, but I'm just curious to know how it's done!

Cheers

Pete


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,302
Default VBA code to enter extended characters onto a worksheet

Hi Peter,

Try:

Sub Tester01()
Dim iCtr As Long
For ictr = 1 To 255
Cells(iCtr, 1) = Chr(iCtr)

Next iCtr

End Sub


---
Regards,
Norman



"Peter Rooney" wrote in message
...
Can anyone help me with a way to enter extended characters into a
worksheet.

I can record myeslf entering something like <<ALT+0166 into a cell, but
the recorder shows the actual character, and not the keystroke sequence.

The reason I want to be able to do this is that I want to be able to write
a
loop that enters all the characters in a character set into successive
cells
in the worksheet thus:

For Counter=1 to 255
selection.formula= (whatever the answer is to this question) e.g.
ALT+0156
selection.offset(1,0).select
Next Counter

then formats them in a particular font, to produce and print character
maps
for all characters in that font.

Not life-threatening, I know, but I'm just curious to know how it's done!

Cheers

Pete




  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 325
Default VBA code to enter extended characters onto a worksheet

Norman,

Thanks very much - just what I needed!

Regards

Pete



"Norman Jones" wrote:

Hi Peter,

Try:

Sub Tester01()
Dim iCtr As Long
For ictr = 1 To 255
Cells(iCtr, 1) = Chr(iCtr)

Next iCtr

End Sub


---
Regards,
Norman



"Peter Rooney" wrote in message
...
Can anyone help me with a way to enter extended characters into a
worksheet.

I can record myeslf entering something like <<ALT+0166 into a cell, but
the recorder shows the actual character, and not the keystroke sequence.

The reason I want to be able to do this is that I want to be able to write
a
loop that enters all the characters in a character set into successive
cells
in the worksheet thus:

For Counter=1 to 255
selection.formula= (whatever the answer is to this question) e.g.
ALT+0156
selection.offset(1,0).select
Next Counter

then formats them in a particular font, to produce and print character
maps
for all characters in that font.

Not life-threatening, I know, but I'm just curious to know how it's done!

Cheers

Pete





  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4,391
Default VBA code to enter extended characters onto a worksheet

Peter,
Does ChrW in place of Chr give you the desired results ?

NickHK

"Norman Jones" wrote in message
...
Hi Peter,

Try:

Sub Tester01()
Dim iCtr As Long
For ictr = 1 To 255
Cells(iCtr, 1) = Chr(iCtr)

Next iCtr

End Sub


---
Regards,
Norman



"Peter Rooney" wrote in message
...
Can anyone help me with a way to enter extended characters into a
worksheet.

I can record myeslf entering something like <<ALT+0166 into a cell,

but
the recorder shows the actual character, and not the keystroke sequence.

The reason I want to be able to do this is that I want to be able to

write
a
loop that enters all the characters in a character set into successive
cells
in the worksheet thus:

For Counter=1 to 255
selection.formula= (whatever the answer is to this question) e.g.
ALT+0156
selection.offset(1,0).select
Next Counter

then formats them in a particular font, to produce and print character
maps
for all characters in that font.

Not life-threatening, I know, but I'm just curious to know how it's

done!

Cheers

Pete






  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 325
Default VBA code to enter extended characters onto a worksheet

Nick,

At first glance, it seems to do the same thing - what's the difference
between CHR and CHRW ?

Pete





"NickHK" wrote:

Peter,
Does ChrW in place of Chr give you the desired results ?

NickHK

"Norman Jones" wrote in message
...
Hi Peter,

Try:

Sub Tester01()
Dim iCtr As Long
For ictr = 1 To 255
Cells(iCtr, 1) = Chr(iCtr)

Next iCtr

End Sub


---
Regards,
Norman



"Peter Rooney" wrote in message
...
Can anyone help me with a way to enter extended characters into a
worksheet.

I can record myeslf entering something like <<ALT+0166 into a cell,

but
the recorder shows the actual character, and not the keystroke sequence.

The reason I want to be able to do this is that I want to be able to

write
a
loop that enters all the characters in a character set into successive
cells
in the worksheet thus:

For Counter=1 to 255
selection.formula= (whatever the answer is to this question) e.g.
ALT+0156
selection.offset(1,0).select
Next Counter

then formats them in a particular font, to produce and print character
maps
for all characters in that font.

Not life-threatening, I know, but I'm just curious to know how it's

done!

Cheers

Pete









  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4,391
Default VBA code to enter extended characters onto a worksheet

Peter,
<VBA Help
.....However, on DBCS systems, the actual range for charcode is -32768 to
65535.

.....The ChrW function returns a String containing the Unicode character
except on platforms where Unicode is not supported, in which case, the
behavior is identical to the Chr function.
</VBA Help

Change "For ictr = 1 To 255" to something like "For ictr = 1 To 60000" and
see what you get.

Nick

"Peter Rooney" wrote in message
...
Nick,

At first glance, it seems to do the same thing - what's the difference
between CHR and CHRW ?

Pete





"NickHK" wrote:

Peter,
Does ChrW in place of Chr give you the desired results ?

NickHK

"Norman Jones" wrote in message
...
Hi Peter,

Try:

Sub Tester01()
Dim iCtr As Long
For ictr = 1 To 255
Cells(iCtr, 1) = Chr(iCtr)

Next iCtr

End Sub


---
Regards,
Norman



"Peter Rooney" wrote in

message
...
Can anyone help me with a way to enter extended characters into a
worksheet.

I can record myeslf entering something like <<ALT+0166 into a

cell,
but
the recorder shows the actual character, and not the keystroke

sequence.

The reason I want to be able to do this is that I want to be able to

write
a
loop that enters all the characters in a character set into

successive
cells
in the worksheet thus:

For Counter=1 to 255
selection.formula= (whatever the answer is to this question)

e.g.
ALT+0156
selection.offset(1,0).select
Next Counter

then formats them in a particular font, to produce and print

character
maps
for all characters in that font.

Not life-threatening, I know, but I'm just curious to know how it's

done!

Cheers

Pete









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
Can't enter characters, is some sort of auto-correct on? TomCon via OfficeKB.com Excel Discussion (Misc queries) 1 April 21st 09 06:54 AM
Help,,,my keyboard is locked and can not enter characters n excel Chris H. Excel Discussion (Misc queries) 2 September 8th 06 05:18 PM
enter formula to copy characters in a cell less last one BC@D Excel Discussion (Misc queries) 1 April 5th 06 11:19 PM
Is it possible to enter more than 255 characters in a cell Dajana Excel Discussion (Misc queries) 2 September 15th 05 09:14 PM
From worksheet enter DO-Loop start & end code Bob Leonard[_2_] Excel Programming 1 December 1st 03 09:42 PM


All times are GMT +1. The time now is 02:14 PM.

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"