将特定单元格从一个工作表复制并粘贴到另一个工作表
我有一个电子表格Sheet1,如图1所示,其中有一些带有单元格值的行.尝试在Excel中将单元格从一个工作表复制并粘贴到另一个工作表时遇到问题.如下面的图1所示,我有一排带有值的行,我想从Sheet1复制单元格并将其粘贴到Sheet2,如图2所示.
I have a spreadsheet Sheet1 I have a row with some cell values as shown in Image 1. I am having a problem trying to copy and paste cells from one worksheet to another in excel. As shown in the below Image 1, I have a row with values and I want to copy the cells from Sheet1 and paste it to Sheet2 as shown in Image 2.
有人可以告诉我该怎么做吗?
Can anyone please tell me how to do that?
在Sheet2的第一个单元格中,写:
For the first cell on Sheet2, write:
=Sheet1!A4
然后另外两个如下:
=Sheet1!D4
=Sheet1!G4
也就是说,即使更新Sheet1上的值也要具有相同的值.如果没有,也许您想要vba代码?创建一个新模块:
That is, if you want to have the same values even if you update the ones on Sheet1. If not, perhaps you want vba code? Create a new module:
sub copy()
dim sheet1 as Worksheet, sheet2 as Worksheet
sheet1 = Worksheets("Sheet1")
sheet2 = Worksheets("Sheet2")
sheet2.Cells(1,"A").Value=sheet1.Cells(4,"A").Value
sheet2.Cells(2,"A").Value=sheet1.Cells(4,"D").Value
sheet2.Cells(3,"A").Value=sheet1.Cells(4,"G").Value
end sub