Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4
Default Using Hebrew in a Macro

Hi,
I need to be able to write hebrew letters to an excel spreadsheet from my
macro. I already have hebrew support installed on Windows XP.
What is the simplest way to do this?
I noticed I can't type in hebrew withen the Macro - is there a way to hard
code any text?

Thank you

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,058
Default Using Hebrew in a Macro

Use unicode. Write the characters as unicode and set a font to support the
characters.


see:

http://unicode.org/charts/PDF/U0590.pdf


--
Gary''s Student - gsnu200718


"Yehuda" wrote:

Hi,
I need to be able to write hebrew letters to an excel spreadsheet from my
macro. I already have hebrew support installed on Windows XP.
What is the simplest way to do this?
I noticed I can't type in hebrew withen the Macro - is there a way to hard
code any text?

Thank you

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4,391
Default Using Hebrew in a Macro

Whilst you cannot type Hebrew (or rather any non-ANSI text) in the VBE, you
can work with its Unicode numbers, either Hex or decimal and the ChrW
function.
If you are bring this Hebrew text into VBA from outside (a text file or some
other app) look into using Byte arrays and StrConv.

Dim Unicodes As Variant
Dim i As Long

Const SomeHebrewHexCodes As String = "05D0,05E0,05D2,05E6"

For Each Unicodes In Split(SomeHebrewHexCodes, ",")
Range("A1").Offset(i, 0).Value = ChrW("&H" & Unicodes)
i = i + 1
Next

You can get the code for any letter on the worksheet with:

Public Function GetUnicodeValue(argText As Variant, _
WhichLetter As Long, _
Optional AsDecimal As Boolean = True) As
Variant

GetUnicodeValue = AscW(Mid(argText, WhichLetter, 1))
If AsDecimal = False Then GetUnicodeValue = Hex(GetUnicodeValue)

End Function

NickHK

"Yehuda" wrote in message
...
Hi,
I need to be able to write hebrew letters to an excel spreadsheet from my
macro. I already have hebrew support installed on Windows XP.
What is the simplest way to do this?
I noticed I can't type in hebrew withen the Macro - is there a way to hard
code any text?

Thank you



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
tsv file open in turkish font and it should be hebrew why ? Shally Excel Discussion (Misc queries) 6 June 17th 08 01:42 PM
hebrew dates A & C Walters Excel Discussion (Misc queries) 0 November 14th 06 12:14 AM
Sort by Hebrew Date Desperate Dan Excel Discussion (Misc queries) 1 November 17th 05 12:17 AM
Insert Hebrew Date yossele Excel Worksheet Functions 1 May 27th 05 08:20 PM
Hebrew inverted characters macro morris Excel Programming 1 December 4th 03 12:04 PM


All times are GMT +1. The time now is 07:14 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"