About 167,000 results
Open links in new tab
  1. declaring a unicode string in vba in excel - Stack Overflow

    Dec 1, 2016 · As previously mentioned, VBA does support unicode strings, however you cannot write unicode strings inside your code, because the VBA editor only allows VBA files to be encoded in the 8-bit codepage Windows-1252. You can however convert a binary equivalent of the unicode string you wish to have:

  2. excel - Unicode string literals in VBA - Stack Overflow

    I would like to declare (in a VBA class module) some private constant strings that contain Japanese characters. Is there a way to construct String literals (or combining literals in a way) that may be accepted as initializers in a Const declaration? i.e. something like:

  3. How to save .txt as Unicode or UTF-8 in VBA - Stack Overflow

    Jun 19, 2015 · I want that all my files be saved in unicode or utf-8 format and not ANSI. Here is the code: iFile = FreeFile. With Rows(iRow) sPath = "E:\" & .Range("B1").Value & "\" If Len(Dir(sPath, vbDirectory)) = 0 Then MkDir sPath. sFile = .Range("D1").Value & ".txt" Open sPath & sFile For Output As #iFile. Print #iFile, .Range("E1").Value. Close #iFile.

  4. VBA functions with respect to Unicode characters - Excel Help …

    Jul 12, 2018 · So, to include Unicode characters in a VBA string, you can use the Character Wide (ChrW) function. Another way is to use the Windows API. This method is very low level coding and not as straightforward.

  5. Solving the Unicode, UTF8, UTF16 and Text Files conundrum in VBA

    Jan 11, 2020 · Understanding Unicode variants like UTF8 and UTF16 and how they impact your Office VBA development is not so straightforward. This post will guide thru the experience of reading a text file with VBA, explain some of the pitfalls you may encounter on this path when dealing with different text encodings and file formats.

  6. VBA Strings Module - VBA Planet

    Returns a character given a Unicode character code if Unicode is supported. If Unicode is not supported it is the same as Chr. Returns Variant/String. *Do not use ChrW on a Mac.

  7. Tools for working with Unicode in the VB Editor

    Tools for working with Unicode in the VB Editor. This repository contains a standard VBA module ProgrammingTools.bas and associated userforms for working with Unicode text in the VB Editor (VBE). The code in these VBA modules references the following libraries. Microsoft Visual Basic for Applications Extensibility 5.3.

  8. Unicode, Decimal, ASCII and more with VBA StrConv

    Aug 21, 2015 · Use the VBA StrConv function to convert ASCII strings to Upper, Lower or Proper case. The powerful StrConv function even has built in support for converting between strings, Unicode and ASCII Decimal character byte arrays. This article will teach you the basics of the StrConv function, along with a few more advanced tricks.

  9. VBA Strings & Characters - UNICODE Characters

    Apr 9, 2025 · ASCW - Returns the Unicode number for the first character in a text string. CHRW - Returns the character with the corresponding Unicode number. This returns the bit pattern for unsigned 16-bit integers. VBA uses signed 16-bit integers so after 32767 this function will return negative numbers. ASCW_2 = (ASCW(sChar) And &HFFF&) .

  10. unicode characters in VBA editor | MrExcel Message Board

    Nov 6, 2008 · If you mean you have imported or pasted a text with symbols into a cell and you'd like to know its Unicode code, use the AscW() function. For ex., to know the Unicode code of the second character in A1 in decimal MsgBox AscW(Mid(Range("A1"), 2, 1)) or in hex MsgBox Application.WorksheetFunction.Dec2Hex(AscW(Mid(Range("A1"), 2, 1))) Hope this helps

Refresh