Excel宏 - 将单元格复制到下一行中的同一列 [英] Excel macro-- copy cell to same column in next row

查看:458
本文介绍了Excel宏 - 将单元格复制到下一行中的同一列的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我确定这很简单,但我只是从这些类型的任务开始。我需要将一个单元格值复制到下一行中的同一列,并循环访问所有数据。我可以使用它两次为2个不同的列执行此操作,或将这两个步骤合并为一个。更具体地说:我需要将单元格A1复制到B1(等)并将单元格D1复制到D2(等等) - 所有这些都在同一工作表上。这两个复制/粘贴操作需要继续,直到没有数据 - 这两个集合将同时发生。任何帮助都是值得赞赏的 - 我想让这项任务变得更快,更轻松!

I''m sure this is very simple, but I''m just starting with these types of tasks. I need to copy a cell value to the same column in the next row and cycle thru all data. I can use this twice to do this for 2 different columns or combine these two steps into one. More specifically: I need to copy cell A1 to B1 (etc.) and copy cell D1 to D2 (etc.)--all on the same worksheet. These 2 copy/paste operations need to continue until there is no data--which will happend at the same time for both sets. Any help is gresatly appreciated--I want to make this task faster and less boring!

推荐答案

spmartin2012,

虽然这是一个Access VBA论坛,请描述您的数据集。我不确定我是否遵循了需要发生的事情,因为A1到B1将数据复制到右边的一个单元格,D1到D2将数据复制到一个单元格。我不知道如果没有数据我会理解如何继续...


请解释一下,提供您的数据样本。
spmartin2012,

Although this is an Access VBA forum, please describe your data set. I''m not sure I follow what needs to happen, as the A1 to B1 copies data one cell to the right, and D1 to D2 copies data one cell down. I''m not sure I understand how to continue that until there is no data.....

Please explain, providing a sample of your data.


对不起输入错误 - 我想向下复制两个单元格,从A1和D1开始并重复直到没有数据。我已经使用宏在每个原始行下面插入一个空行,因此有空行可以粘贴单元格值的副本。列A和D在新创建的行中始终与上面的行具有相同的值。其他列用于手动输入数据。非常感谢任何帮助!
Sorry for the typo--I want to copy both cells downward, starting with A1 and D1 and repeating until there is no data. I have already used a macro to insert a blank line below each original row, so there are blank rows in which to paste the copy of the cell value. Columns A and D will always have the same value in the newly created row as the row above. The other columns are for manually entered data. THANKS so much for any help!


到目前为止您有什么代码?
What code do you have so far?


这篇关于Excel宏 - 将单元格复制到下一行中的同一列的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆