字节数组作为VBA中的字符串表示形式

时间:2015-12-24 04:22:49

标签: vba excel-vba excel

我正在努力学习我的字节数组。它不是转换为字符串,而只是给出问号,我认为第一个字节var pomodoro = { SCountDown: 0, customization: function(chooseSession) { console.log(chooseSession); }, sessionPlus: function() { this.SCountDown++; this.customization(this.SCountDown); } } pomodoro.sessionPlus(); pomodoro.sessionPlus(); 可能有问题。有人可以帮我查看我的代码吗?感谢。

b(0)

1 个答案:

答案 0 :(得分:1)

你试图显示一个字节,但它实际上是一个字节数组。

选项1

将类型从Byte更改为Variant并使用加入。您必须将eb变量更改为Variant Join数据类型才能生效。优点是您可以避免循环并且易于遵循。

MsgBox Join(e, "")

选项2

循环遍历数组并显示每个值。

Dim itm As Variant
For Each itm In e
    Debug.Print itm
Next itm

<强>加成

您也可以将数组输出到单元格。

Dim Destination As Range
Set Destination = Worksheets("Sheet1").Range("A1")
Set Destination = Destination.Resize(1, UBound(e))
Destination.Value = e

enter image description here

输出Ascii字符时的结果(鼠标悬停以显示剧透)

  

enter image description here

相关问题