Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
set unicode in macro
I wrote a macro - xla.
it returns manipulated and translated strings. after passing to win7 i get the output in wrong language code, probably unicode problem. how can i assign a unoicode string into a varialble? thanks in advance |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
set unicode in macro
Here is one way:
Sub test() Dim S1 As String Dim S2() As Byte Dim L As Long S1 = "Hello World" 'to unicode: S2 = StrConv(S1, vbUnicode) ' byte array in the immedate window: For L = LBound(S2) To UBound(S2) Debug.Print L, S2(L), Chr(S2(L)) Next 'convert back: S1 = StrConv(S2, vbFromUnicode) MsgBox S1 End Sub HTH. Best wishes Harald "GadyC" skrev i melding ... I wrote a macro - xla. it returns manipulated and translated strings. after passing to win7 i get the output in wrong language code, probably unicode problem. how can i assign a unoicode string into a varialble? thanks in advance |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
set unicode in macro
Use Chr(). For example:
Sub dural() ActiveCell.Font.Name = "Arial Unicode MS" ActiveCell.Value = ChrW(8457) End Sub will put a degrees Fahrenheit symbol in a cell. -- Gary''s Student - gsnu200909 "GadyC" wrote: I wrote a macro - xla. it returns manipulated and translated strings. after passing to win7 i get the output in wrong language code, probably unicode problem. how can i assign a unoicode string into a varialble? thanks in advance |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
I want to define the use of Unicode globally in a VBA macro in Ex. | Excel Programming | |||
how do I use macro to find and replace unicode characters | Excel Discussion (Misc queries) | |||
Changing a macro to save as Unicode text | Excel Programming | |||
Changing a macro to save as Unicode text | Excel Programming | |||
A macro to export a sheet as UTF8 encoded Unicode file | Excel Programming |