【问题标题】:Copy column from one Excel sheet to another Excel sheet [closed]将列从一个 Excel 工作表复制到另一个 Excel 工作表 [关闭]
【发布时间】:2012-08-10 04:57:00
【问题描述】:

我想将特定列从一个 Excel 工作表复制到另一个工作簿中的另一个 Excel 工作表。如何使用宏将某些列复制到不同的 Excel 工作表?

【问题讨论】:

    标签: vba excel


    【解决方案1】:

    假设您有两个工作簿(源和目标),并且您希望将源工作簿中的 A 列复制到目标工作簿中的 A 列。

    Sub CopyColumnToWorkbook()
        Dim sourceColumn As Range, targetColumn As Range
    
        Set sourceColumn = Workbooks("Source").Worksheets("Sheet1").Columns("A")
        Set targetColumn = Workbooks("Target").Worksheets("Sheet1").Columns("A")
    
        sourceColumn.Copy Destination:=targetColumn
    End Sub
    

    显然,您可以根据需要更改列。

    【讨论】:

      猜你喜欢
      • 2018-07-22
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2012-08-28
      • 2013-10-26
      • 2016-09-17
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多