因此,实际上所有内容都正确地粘贴到了工作簿,但是,我添加了额外的数据列,其中输入了公式。现在,当我运行宏时,它是在复制并粘贴公式,而不是从公式生成的值。
我进去,将wbData.ActiveSheet.Paste
更改为wbData.ActiveSheet.PasteSpecial x1PasteValue
,但是它不起作用。想知道我是否将其插入错误的位置吗?
Dim wbTime As Workbook
Set wbTime = ThisWorkbook
Dim wbData As Workbook
Dim LastRow As Long
Set wbTime = ActiveWorkbook
With wbTime.Sheets("Production Time Sheet")
LastRow = .Range("A" & .Rows.Count).End(xlUp).Row
End With
wbTime.Sheets("Production Time Sheet").Range("A6:O" & LastRow).Copy
Set wbData = Workbooks.Open("S:\Lean Carrollton Initiative\Michael\Time Sheet Data - LT Test.xlsx")
wbData.ActiveSheet.PasteSpecial x1PasteValue Destination:=Worksheets("Log").Range("A" & Rows.Count).End(xlUp).Offset(1, 0)
wbData.Close SaveChanges:=True
End Sub
答案 0 :(得分:1)
我总是会选择要粘贴的范围
@HostListener('window:scroll', ['$event'])
scrollHandler(event) {
console.log('Scroll Event');
// console.log(event);
const verticalOffset =
window.pageYOffset ||
document.documentElement.scrollTop ||
document.body.scrollTop ||
0;
console.log(verticalOffset);
}