我目前有一个计算D和E列差异的电子表格。在月末,我想将这些值复制并粘贴到另一个工作表的另一列中(D复制值在"历史贷款数量& #34;,E - in"历史UPB)来跟踪每月的差异。
我开发了一个宏,它将需要从列D和E复制的内容复制到N列。但我真正需要的是每次运行宏时都要复制D和E列的值,将其粘贴到其他工作表中的新下一列。
我在这里找到了一个类似的问题(在一个工作簿中复制和粘贴数据)。使用Offset属性解决了这个问题,但是,如果我理解正确,我就无法使用不同的工作表来应用Offset。
Sheets("Forecast Tableau format").Select
Range("D3:D6").Select
Selection.Copy
Sheets("Historical Loan Count").Select
Range("N2").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Sheets("Forecast Tableau format").Select
Range("D7:D10").Select
Application.CutCopyMode = False
Selection.Copy
Sheets("Historical Loan Count").Select
Range("N9").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
ActiveWindow.SmallScroll Down:=6
Sheets("Forecast Tableau format").Select
Range("D11:D14").Select
Application.CutCopyMode = False
Selection.Copy
Sheets("Historical Loan Count").Select
Range("N16").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Sheets("Forecast Tableau format").Select
Range("D15:D18").Select
Application.CutCopyMode = False
Selection.Copy
Sheets("Historical Loan Count").Select
Range("N23").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Sheets("Forecast Tableau format").Select
Range("D19:D22").Select
Application.CutCopyMode = False
Selection.Copy
Sheets("Historical Loan Count").Select
ActiveWindow.SmallScroll Down:=3
Range("N30").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Sheets("Forecast Tableau format").Select
Range("E3:E6").Select
Application.CutCopyMode = False
Selection.Copy
Sheets("Historical UPB").Select
ActiveWindow.SmallScroll Down:=-3
Range("N2").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Sheets("Forecast Tableau format").Select
Range("E7:E10").Select
Application.CutCopyMode = False
Selection.Copy
Sheets("Historical UPB").Select
Range("N9").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Sheets("Forecast Tableau format").Select
Range("E11:E14").Select
Application.CutCopyMode = False
Selection.Copy
Sheets("Historical UPB").Select
Range("N16").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
ActiveWindow.SmallScroll Down:=3
Sheets("Forecast Tableau format").Select
Range("E15:E18").Select
Application.CutCopyMode = False
Selection.Copy
Sheets("Historical UPB").Select
Range("N23").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
ActiveWindow.SmallScroll Down:=6
Sheets("Forecast Tableau format").Select
Range("E19:E22").Select
Application.CutCopyMode = False
Selection.Copy
Sheets("Historical UPB").Select
Range("N30").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
End Sub