PasteSpecial 列宽
PasteSpecial Column Widths
谁能告诉我为什么这不是粘贴指定单元格中复制的内容
Dim FinalRow As String
FinalRow1 = 112 - Quantity
Let FinalRow = "112" & ":" & FinalRow1
'Unhide Rows
For i = 1 To Quantity
Rows(FinalRow).EntireRow.Hidden = False
Next
Dim RowToPaste As String
RowToPaste = "C" & FinalRow1
Range("C112:AM113").Select
Selection.Copy
Range(RowToPaste).Select
Selection.PasteSpecial Paste:=xlPasteColumnWidths
Range("C112:AM113").Select
Selection.Borders.LineStyle = xlNone
Range("C112:AM113").ClearContents
它确实清除了内容并删除了边框,我知道它在复制单元格"C112:AM113"但它没有粘贴任何东西
当您使用 xlPasteColumnWidths
时,它只会粘贴列宽(没有值)。如果要粘贴值,请使用 xlPasteValues
或 xlPasteFormulas
谁能告诉我为什么这不是粘贴指定单元格中复制的内容
Dim FinalRow As String
FinalRow1 = 112 - Quantity
Let FinalRow = "112" & ":" & FinalRow1
'Unhide Rows
For i = 1 To Quantity
Rows(FinalRow).EntireRow.Hidden = False
Next
Dim RowToPaste As String
RowToPaste = "C" & FinalRow1
Range("C112:AM113").Select
Selection.Copy
Range(RowToPaste).Select
Selection.PasteSpecial Paste:=xlPasteColumnWidths
Range("C112:AM113").Select
Selection.Borders.LineStyle = xlNone
Range("C112:AM113").ClearContents
它确实清除了内容并删除了边框,我知道它在复制单元格"C112:AM113"但它没有粘贴任何东西
当您使用 xlPasteColumnWidths
时,它只会粘贴列宽(没有值)。如果要粘贴值,请使用 xlPasteValues
或 xlPasteFormulas