For Each cell In rng
workSheetName = Format(SaturdayIsComing(), "mm-dd-yyyy") & " " & cell.Value
If WorksheetExists(workSheetName) Then
Dim localRange, localCell As Range
Set localRange = Worksheets(workSheetName).Range("D8:D19")
Dim contents As Variant
contents = ""
Dim firstLine As Boolean
firstLine = True
For Each localCell In localRange
If Len(localCell.Value) > 0 Then
If firstLine Then
contents = contents & localCell.Value & Chr(11)
Else
contents = contents & Chr(9) & Chr(9) & Chr(9) & localCell.Value & Chr(11)
End If
Else
contents = fixString(contents)
End If
If Len(contents) > 0 Then
firstLine = False
End If
Next localCell
For Each cc In wDoc.SelectContentControlsByTag(cell.Value & "Notes")
If Len(contents) > 0 Then
cc.Range.Text = fixString(contents)
Else
cc.Range.Text = "No Issues Found"
End If
Next
Else
errorCodesString = errorCodesString & cell.Value & ":"
End If
Next cell
输出到Word值传递到Word使用VBA
Forgot to terminate the meeting
This is a test message\'s
如果我的单元格中包含'然后我得到一个错误说
One of the values passwed to this method or property is incorrect
我知道' 是在VBA中发表评论。如何在保留某人添加到Excel单元格中的笔记的同时解决此问题?
的内容可能包含“等标点符号。用户可以在键盘上输入任何东西,如#1西班牙的雨......或我最喜欢的 –
您的解决方案是从字符串中删除'(撇号)。有没有办法保留它? –