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西班牙的雨......或我最喜歡的 –
您的解決方案是從字符串中刪除'(撇號)。有沒有辦法保留它? –