我需要将Excel粘贴到文本而不更改Excel格式。我已经让VBA复制了我的数据。但我不知道如何粘贴它们而不忽略Excel格式。
答案 0 :(得分:0)
您可以尝试以下内容:
copyRange.Copy 'copyRange is range you want to copy
With Range(cell_ref) 'cell_ref should is first cell of paste area e.g. Range("A1")
.PasteSpecial xlPasteColumnWidths
.PasteSpecial xlPasteValues, , False, False
.PasteSpecial xlPasteFormats, , False, False
.Cells(1).Select
Application.CutCopyMode = False
End With