VBA删除斜杠

时间:2018-11-21 12:54:25

标签: excel vba

我是Excel中VBA的新手。因此,我从多个部分创建了一个字符串,并将其输出到某个工作表中的单元格中,如下所示:

Sheets("Output").Cells(iRow, 1).Value = LArray(0) + "?" + adding + "/#" + LArrayNew(1)

我期望:text?text/#text 但是excel工作表上的结果是:text?text#text

“ /”在哪里?

1 个答案:

答案 0 :(得分:2)

类似的东西:

Sub dural()
    Dim LArray(0 To 1) As String
    Dim adding As String, LArrayNew(0 To 1) As String

    adding = "X"
    LArrayNew(1) = "New"
    LArray(0) = "0"
    iRow = 1

    Sheets("Output").Cells(iRow, 1).Value = LArray(0) & "?" & adding & "/#" & LArrayNew(1)
End Sub

将产生:

0?X /#New

请注意,斜杠在其中!

enter image description here