Hi,
Try one of the following. If you want a 'double quote' inside a string you have to double up (i.e. put 2 double quotes consecutively). Alternately you can use chr(34) which is the equivalent of ONE 'double quote'.
Sub QuotesGalore()
Dim id(1 To 2) As String
Dim Q As String
Q = Chr(34) 'Single Double Quote
'Original text
'id (1) = create users "/" and/or "notify change"
'id (2) = modify users "and"/"or"
id(1) = "create users ""/"" and/or ""notify change"""
id(2) = "modify users ""and""/""or"""
MsgBox id(1) & vbCrLf & id(2)
id(1) = "create users " & Chr(34) & "/" & Chr(34) & " and/or " & Chr(34) & "notify change" & Chr(34)
id(2) = "modify users " & Chr(34) & "and" & Chr(34) & "/" & Chr(34) & "or" & Chr(34)
MsgBox id(1) & vbCrLf & id(2)
id(1) = "create users " & Q & "/" & Q & " and/or " & Q & "notify change" & Q
id(2) = "modify users " & Q & "and" & Q & "/" & Q & "or" & Q
MsgBox id(1) & vbCrLf & id(2)
End Sub
Lewis
Bookmarks