简体   繁体   English

VBA Excel通过列和行偏移将单元格内容复制到另一个

[英]VBA Excel Copying Cell contents to another via column and row offset

Here is my code这是我的代码

Sub A_Copy_To_Prior_Row_column()
'
' A_Copy_To_Prior_Row_column Macro
'

'
    Application.CutCopyMode = False
    Selection.Copy
    Range("R183").Select
    ActiveSheet.Paste
End Sub

Where R183 is I need to not a specific cell, but a cell based on minus 1 row, and +17 columns of the selected/highlighted cell I wish to copy R183 在哪里我需要的不是特定的单元格,而是基于我希望复制的所选/突出显示的单元格的负 1 行和 +17 列的单元格

activecell.Offset(-1, 17).Value = activecell.Value
Sub A_Copy_To_Prior_Row_column()
'
' A_Copy_To_Prior_Row_column Macro
'

'
    Application.CutCopyMode = False
    With Selection
        .Copy
         ActiveSheet.Paste Destination:=.Offset(-1, 17)
    End With
End Sub

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 Excel VBA - 将单元格内容从一张纸复制到另一张纸 - Excel VBA - copying cell contents from one sheet to another Excel / VBA比较两列并将单元格内容从第三列复制到两张不同工作表中的第四列 - Excel/VBA Comparing two columns and copying the cell contents from a third column into a fourth column in two different sheets VBA-将值从一个单元格复制到另一个偏移量单元格 - VBA- Copying Values from one cell to another offset cell 使用VBA将单元格值复制到Excel中的另一个工作表 - Copying Cell Value to another sheet in Excel with VBA 将列单元格内容与文本文件进行比较,并将匹配的行复制到另一个工作簿VBA - Comparing column cell contents to a text file and copying matching rows to another workbook VBA 将单元格引用复制到另一列VBA - Copying cell references to another column vba 使用 Excel VBA 更新列单元格内容 - Use Excel VBA to update column cell contents Excel宏,用于将单元格内容复制到另一个工作簿中的特定工作表 - Excel macro for copying cell contents to a specific sheet in another workbook 使用VBA将excel工作簿的每一行复制到另一个excel工作簿 - copying each row of an excel workbook to another excel workbook using VBA 在 Excel-VBA 中是否可以仅根据另一个单元格的内容在列(或行或单元格)中移动? - In Excel-VBA Is it possible to move in a column (or row, or cell) based solely on the content of another cell?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM