在 Excel 2003 中将行从一个选项卡复制到另一个选项卡

发布于 2024-10-09 10:30:58 字数 128 浏览 0 评论 0原文

如何编写宏以一次将 43 行复制到另一个选项卡中进行处理,并循环执行第 1 行到第 4300 行(AP 列)的例程?对每个粘贴范围进行的处理是根据粘贴的单元格执行计算,并通过另一个宏在附加表中捕获结果。我使用的是 MS Excel 2003。

How can I code a macro to copy 43 rows at a time into another tab for processing and loop through the routine for Row 1 through Row 4300 (Columns A-P)? The processing done with each pasted range is executing calculations based on the pasted cells and capturing the results in an appended table through another macro. I am using MS Excel 2003.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

忘东忘西忘不掉你 2024-10-16 10:30:58

以下代码将以 43 行块的形式将 Sheet1 中的数据粘贴到 Sheet2 中,例如 A1:P43、A44:A86 等。

Sub CopyData()
    Dim iRow As Long
    Dim rng As Range

    For iRow = 1 To 4258 Step 43
        Set rng = Range("A" & iRow & ":P" & (iRow + 42))
        rng.Copy Destination:=Worksheets("Sheet2").Range("A1") //Copy into A1:P43 on Sheet2
        //Call your existing Macro here to process data?
    Next
End Sub

The following code will paste data from Sheet1 in blocks of 43 rows into Sheet2 e.g. A1:P43, A44:A86 etc.

Sub CopyData()
    Dim iRow As Long
    Dim rng As Range

    For iRow = 1 To 4258 Step 43
        Set rng = Range("A" & iRow & ":P" & (iRow + 42))
        rng.Copy Destination:=Worksheets("Sheet2").Range("A1") //Copy into A1:P43 on Sheet2
        //Call your existing Macro here to process data?
    Next
End Sub
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文