2016-01-22 81 views
2

複製並粘貼到記事本中的每個報價後,我有存儲在單元在工作表中現在額外的引號,當我從Excel

<tr onmouseover="this.style.backgroundColor='#74eb61';" onmouseout="this.style.backgroundColor='#e8e8e8';">

,當我從我複製並粘貼到記事本以下文本獲得額外的報價標誌後,每帖所以它變得像下面的字符串

<tr onmouseover=""this.style.backgroundColor='#74eb61';"" onmouseout=""this.style.backgroundColor='#e8e8e8';"">

enter image description here

您可以通過創建此:

複製這樣的文字:

<!-- CSS goes in the document HEAD or added to your external stylesheet --> 
<style type="text/css"> 
table.hovertable { 
font-family: verdana,arial,sans-serif; 
font-size:11px; 
color:#333333; 
border-width: 1px; 
border-color: #999999; 
border-collapse: collapse; 
} 
table.hovertable th { 
background-color:#009fe3; 
    color:#FFFFFF; 
border-width: 1px; 
padding: 8px; 
border-style: solid; 
border-color: #a9c6c9; 
} 
table.hovertable tr { 
background-color:#e8e8e8; 

} 
table.hovertable td { 
border-width: 1px; 
padding: 8px; 
border-style: solid; 
border-color: #a9c6c9; 
} 
</style> 
<!-- Table goes in the document BODY --> 
<table class="hovertable"> 
<th colspan="4">Info Header</th> 

<tr onmouseover="this.style.backgroundColor='#74eb61';" onmouseout="this.style.backgroundColor='#e8e8e8';"> 
<td>Item 1A</td><td>Item 1B</td><td>Item 1C</td> 
</tr> 

<tr onmouseover="this.style.backgroundColor='#74eb61';" onmouseout="this.style.backgroundColor='#e8e8e8';"> 
<td>Item 2A</td><td>Item 2B</td><td>Item 2C</td> 
</tr> 

<tr onmouseover="this.style.backgroundColor='#74eb61';" onmouseout="this.style.backgroundColor='#e8e8e8';"> 
<td>Item 3A</td><td>Item 3B</td><td>Item 3C</td> 
</tr> 

<tr onmouseover="this.style.backgroundColor='#74eb61';" onmouseout="this.style.backgroundColor='#e8e8e8';"> 
<td>Item 4A</td><td>Item 4B</td><td>Item 4C</td> 
</tr> 

<tr onmouseover="this.style.backgroundColor='#74eb61';" onmouseout="this.style.backgroundColor='#e8e8e8';"> 
<td>Item 5A</td><td>Item 5B</td><td>Item 5C</td> 
</tr> 

</table> 

,並粘貼到任何單元格在Excel

,然後複製單元格的內容並粘貼記事本,你會發現額外的報價

+0

刪除字符串Stystr = Replace(Trim(wh.Range(「A2」).text),「」「」,「」)中現有的引號 –

+0

也在聲明中Dim Stystr,endHTb,StRTb ,tbstr,tbTag,ctb As String'只** ** ctb **被標註爲'String'類型。所有其他的都是變種。要將它們都標註爲'String'類型,請將'Dim Stystr as String,endHTb as String,StRTb as String ...'寫成' –

+0

@ScottHoltzman nope我不認爲這樣做會起作用,因爲每個''''都被' ''''''''''替換爲'''',因此無法區分哪些需要替換 – newguy

回答

3

這是'行爲設計'。在將單元格值從XL傳輸到Notepad ++的過程中,剪貼板的參與意味着文本字符串被評估。有很多場景經過測試(我沒有完整的列表),但看起來您的粘貼操作被解釋爲創建逗號分隔或製表符分隔的TXT導出文件。引號字符正在翻倍,因爲您的系統在XL到TXT導出中使用引號字符作爲特殊字符。

不幸的是,你不希望這種過渡行爲,但其他許多人都這樣做。如果您需要繞過它,請在編輯模式下從公式欄或單元格中複製文本字符串。這不是Excel的行爲,甚至是辦公剪貼板(OCB)。這是Windows剪貼板的行爲,它試圖解釋從XL到Notepad ++的傳輸。

+0

好吧。謝謝 – newguy

+0

tbh,我覺得它也很煩人。任何過渡轉換*都應該能夠繞過(例如,右鍵單擊,粘貼值類型行爲)。 – Jeeped