【问题标题】:Copy entire row under current column, based on value in cell根据单元格中的值复制当前列下的整行
【发布时间】:2014-08-13 06:56:53
【问题描述】:

code that covers my problem

我正在尝试根据单元格中的值复制当前列下的整行。 当 A1 中为 5 时,则复制 5 次。 我发现的代码仅限于一行中的几列。

【问题讨论】:

    标签: vba excel copy row


    【解决方案1】:

    使用代码在新工作表中重新创建表格。

    要更新您可以替换的代码

    Sheet2.Range("A" & currentNewSheetRow).Value2 = Sheet1.Range("A" & currentRow).Value2
    Sheet2.Range("B" & currentNewSheetRow).Value2 = Sheet1.Range("B" & currentRow).Value2
    Sheet2.Range("C" & currentNewSheetRow).Value2 = Sheet1.Range("C" & currentRow).Value2
    

        Sheet2.Range("A" & currentNewSheetRow).entirerow.Value2 = Sheet1.Range("A" & currentRow).entirerow.Value2
    

    这将复制整行的值。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2022-12-10
      • 1970-01-01
      • 1970-01-01
      • 2015-11-18
      • 1970-01-01
      • 2013-12-11
      • 2012-07-16
      相关资源
      最近更新 更多