![]() ![]() To convert a string to a number of the Byte data type, use the CByte function to convert the String to a number of the Byte data type. Description: The CByte function coerces String to the Byte data type.ĬByte is usually able to carry out internationally-aware conversions from the String to the Byte data type.In other words, CByte generally recognizes between the different decimal/thousand separators and currency options that depend on your computer's locale. The Byte data type can hold numbers ranging from 0 to 255. If String is outside this range, an error occurs. VBA construct: String expression and expression argument of the CByte function.Description: String is the string or numeric expression you convert to the Byte data type. The following macro example, a User-Defined Function, converts a string passed as argument (myString) to Byte.įunction stringToByte(myString As Variant)Įffects of executing macro example to convert String to Byte If you explicitly declare a variable to represent String, use the Variant data type. ![]() The following image illustrates the results of using the macro example in a worksheet formula.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |