Skip to content

More on Wrapping Text Values in Quotes

A reader responds to my tip on wrapping text values in quotes, suggesting a function to streamline it.

In response to my tip on wrapping text values in quotes using the Chr$ function, Stuart R Ainsworth contributed a function that streamlines this process (I have modified it slightly, and split it into two functions – one for single quotes and one for double quotes):

 

Public Function SQ(str2BQuoted As String) As String

 

   SQ = Chr$(39) & str2BQuoted & Chr$(39)

 

End Function

 

Public Function DQ(str2BQuoted As String) As String

 

   DQ = Chr$(34) & str2BQuoted & Chr$(34)

 

End Function

About this author