Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations cowski on being selected by the Eng-Tips community for having the most helpful posts in the forums last week. Way to Go!

How I circunavigated the problem with excel adding quotes to text

Status
Not open for further replies.

Susangrizly

Civil/Environmental
Joined
May 29, 2024
Messages
1
Location
GB
thread766-355052

Hi All,
I was having the same struggles of the thread above where the new versions of excel add quotes at the beginning and at the end if there are double quotes within the cell. This happened to me when I was parsing xmlns with mathml formulas and html. So I ended creating a macro in personal xlsb with the code below

'Copy to Clipboard without quotes
Public Sub CopySelection()
CopyText Selection.Text
End Sub

Sub CopyText(Text As String)
'VBA Macro using late binding to copy text to clipboard.
'By Justin Kay, 8/15/2014
Dim MSForms_DataObject As Object
Set MSForms_DataObject = CreateObject("new:{1C3B4210-F441-11CE-B9EA-00AA006B1A69}")
MSForms_DataObject.SetText Text
MSForms_DataObject.PutInClipboard
Set MSForms_DataObject = Nothing
End Sub

and then creating a button and hotkey for it.

Good luck.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top