I am trying to add single quotes to values in a column by using Chr(39)
, but I am only getting the second quote.
e.g. I want 'value' but I am getting value'
But if I use double quotes by using Chr(34)
it works, and I get "value"
Sub AddQuote()
Dim myCell As Range
For Each myCell In Selection
If myCell.Value <> "" Then
myCell.Value = Chr(39) & myCell.Value & Chr(39)
End If
Next myCell
End Sub
just add another single quote:
Sub AddQuote()
Dim myCell As Range
For Each myCell In Selection
If myCell.Value <> "" Then
myCell.Value = Chr(39) & Chr(39) & myCell.Value & Chr(39)
End If
Next myCell
End Sub
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With