我有以下代码:
cell_val = CStr(Nz(fld.value, "")) Dim iter As Long For iter = 0 To Len(cell_val) - 1 Step 1 If Asc(Mid(cell_val, iter, 1)) > 127 Then addlog "Export contains ascii character > 127" End If Next iter
此代码不起作用.有人知道怎么做吗?我根本不知道VB或VBA.
我相信你的问题是在VBA字符串索引从1开始而不是从0.尝试以下内容:
For iter = 1 To Len(cell_val) If Asc(Mid(cell_val, iter, 1)) > 127 Then addlog "Export contains ascii character > 127" End If Next