如何从特定单元格复制数据? [英] How to copy data from specific cells?
问题描述
实际上我正在将列从其他工作表复制到sheet1.i已成功复制1张。但我想从复制结束的单元格开始复制数据。
A
--------- ---------
1医院设施
------------------
2 General Ward
------------------
3半私人病房
------------------
4半私人病房
--------- ---------
5医生访问费用
---------------------
6医生访问费用
---------------------
7护理费用
---------------------
8护理费
----------------------
9需要存款(入场费)
----- ----------------
10
----------------- ---
i已将数据复制到第9行,现在我想开始使用vba从其他工作表中复制第10行的数据
我该怎么做?
我尝试过:
i我正在尝试这段代码< br $>
Actually i am copying column from other sheets to sheet1.i have succeed to copy 1 sheet.but i want start copying data from cell where copying ended before.
A
------------------
1 Hospital Facility
------------------
2 General Ward
------------------
3 Semi Private Ward
------------------
4 Semi Private Ward
------------------
5 Doctor Visit Charges
---------------------
6 Doctor Visit Charges
---------------------
7 Nursing Charges
---------------------
8 Nursing Charges
----------------------
9 Deposit Required (For Admission)
---------------------
10
--------------------
i have copied data to 9 th row,now i want to start copying data from 10 th row from other sheets using vba
how can i do that?
What I have tried:
i am trying this code
Public Sub m()
n = ThisWorkbook.Worksheets.Count
For i = 2 To n
ThisWorkbook.Worksheets(i).Select
ThisWorkbook.Worksheets(i).Columns(2).Copy Destination:=ThisWorkbook.Worksheets("sheet1").Columns(1)
lastRow = ThisWorkbook.Worksheets("sheet1").Cells(Rows.Count,"A").End(xlUp).Row
Next
End Sub
推荐答案
通过复制列
,可以防止自己做你想做的事。
您基本上有两种可能性:
您可以按单元格复制单元格或复制范围。
By copyingColumns
, you prevent yourself from doing what you want.
You have basically 2 possibilities:
You can copy Cell by Cell or copy Ranges.
这篇关于如何从特定单元格复制数据?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!