T
tom
Why can I not get this to work? I want to add quotes around text in a
range, using the following routine:
--------------
Sub addQuotes()
Dim cell As Range
Dim contents As String
Dim quotes As String
quotes = ""
For Each cell In Range("a1:aw1")
If IsEmpty(cell.Text) = False Then
contents = cell.Text
cell.Value = quotes & contents & quotes
End If
Next cell
End Sub
----------------
But the quotes don't show up. If the variable quotes is """" then I
get double quotes around the text.
What is a better way to approach this?
Thanks for your help.
-tom
range, using the following routine:
--------------
Sub addQuotes()
Dim cell As Range
Dim contents As String
Dim quotes As String
quotes = ""
For Each cell In Range("a1:aw1")
If IsEmpty(cell.Text) = False Then
contents = cell.Text
cell.Value = quotes & contents & quotes
End If
Next cell
End Sub
----------------
But the quotes don't show up. If the variable quotes is """" then I
get double quotes around the text.
What is a better way to approach this?
Thanks for your help.
-tom