1

请验证这是否可能...

我有一个 5 人团队。我们每个人都有本地 excel 文件,用作项目跟踪器。我们希望在 OneDrive 上使用 Excel Online 中的主项目跟踪器进行高级别的协作,但单独继续使用我们的本地跟踪器来更新每个项目的更详细信息。

我了解 Excel Online 无法运行宏。但是,我们的本地文件是否可以每个文件都运行一个宏,将我们每周的项目更新自动复制并粘贴到 Excel Online 中的这个主跟踪器中?

我没有找到任何关于此的内容。我想知道这是否可能做到,或者是否有人有比这更好的解决方案来满足我们的需要。

下面是从一个工作簿复制和粘贴到另一个工作簿的代码。如何将其更改为复制并粘贴到 Excel Online 工作簿?如果这甚至是可能的。

Sub Copy_Paste_Below_Last_Cell()
'Find the last used row in both sheets and copy and paste data below existing data.

Dim wsCopy As Worksheet
Dim wsDest As Worksheet
Dim lCopyLastRow As Long
Dim lDestLastRow As Long

  'Set variables for copy and destination sheets
  Set wsCopy = Workbooks("New Data.xlsx").Worksheets("Export 2")
  Set wsDest = Excel Online Workbook

  '1. Find last used row in the copy range based on data in column A
  lCopyLastRow = wsCopy.Cells(wsCopy.Rows.Count, "A").End(xlUp).Row

  '2. Find first blank row in the destination range based on data in column A
  'Offset property moves down 1 row
  lDestLastRow = wsDest.Cells(wsDest.Rows.Count, "A").End(xlUp).Offset(1).Row

  '3. Copy & Paste Data
  wsCopy.Range("A2:D" & lCopyLastRow).Copy _
    wsDest.Range("A" & lDestLastRow)
4

0 回答 0