DTMGIS
和DTMEdit
DTMEdit
表格为空DTMGIS
中的所有内容进行复制,并仅将值粘贴到工作表DTMEdit
我不知道如何仅选择UsedRange
并将其粘贴到DMTEdfit
Dim ws As Worksheet
Dim LastRow As Long, LastCoulmn As Long, Header As Long
Header = 2
Set ws = ThisWorkbook.Sheets("DTMGIS")
LastRow = ws.UsedRange.Rows.Count
LastCoulmn = ws.UsedRange.Column.Count
With ws.UsedRange
.Select
.Copy
End With
答案 0 :(得分:0)
尝试这样的事情:
Sub CopyPasteValues()
Dim ws1 As Worksheet, ws2 As Worksheet
Set ws1 = ThisWorkbook.Sheets("DTMGIS")
Set ws2 = ThisWorkbook.Sheets("DTMEdit")
ws1.Range(ws1.UsedRange.Address).Copy
ws2.Range("a1").PasteSpecial xlPasteValues
End Sub
答案 1 :(得分:0)
以下的变体
UsedRange
从A1 .Copy
使用Application.CutCopyMode = False
)码
Sub FastCopy()
Dim ws1 As Worksheet
Dim ws2 As Worksheet
Set ws1 = ThisWorkbook.Sheets("DTMGIS")
Set ws2 = ThisWorkbook.Sheets("DTMEdit")
ws2.Range(ws1.UsedRange.Address).Value = ws1.UsedRange.Value
End Sub