简体   繁体   English

从 Google 表格复制特定范围并将值粘贴到 excel

[英]Copy specific range from Google Sheets & Paste the values to excel

This is my first post & hello to everyone这是我的第一篇文章&大家好

I'm using Excel 2003 & Not a programmer - Can do some basic VBA coding.我正在使用 Excel 2003 而不是程序员 - 可以做一些基本的 VBA 编码。

GOAL: (Reproduce the effect of Ctrl+C from Google Sheets & Paste special - Text to Excel)目标:(重现 Ctrl+C 从 Google Sheets & Paste special - Text to Excel 的效果)

Use VBA to Copy the range "C2:E5" of a google sheet & paste it's values to range "O31:Q34" in Excel document.使用 VBA 复制谷歌工作表的范围“C2:E5”并将其值粘贴到 Excel 文档中的范围“O31:Q34”。 Using a button in Excel would be nice.使用 Excel 中的按钮会很好。

I've tried to follow several similar posts and leads: Script to copy range/cells value from Google Spreadsheet - paste in Excel我尝试关注几个类似的帖子和线索: Script to copy range/cells value from Google Spreadsheet - paste in Excel

Copy data from Google Sheet to Excel 将数据从 Google 表格复制到 Excel

And while some were promising, it were too advance for my knowledge.虽然有些人很有希望,但据我所知,这太超前了。 Is there any simple way to reproduce that copy/paste?有没有简单的方法来复制该复制/粘贴? Thank you in advance.-先感谢您。-

EDIT: The excel file and the google sheet are kept open at all times.编辑: excel 文件谷歌表始终保持打开状态。 The values of the google sheet change every 15 seconds or so and I manually use copy/paste to transfer them.谷歌表的值每 15 秒左右更改一次,我手动使用复制/粘贴来传输它们。

First: Share your spreadsheet from google with editor mode, ie: https://docs.google.com/spreadsheets/d/19285912859128591859-LIFFM/edit?usp=sharing首先:使用编辑器模式从谷歌分享您的电子表格,即: https://docs.google.com/spreadsheets/d/19285912859128591859-LIFFM/edit?usp=sharing

Second: Edit the URL like this with "export?format and xlsx": https://docs.google.com/spreadsheets/d/19285912859128591859-LIFFM/export?format=xlsx第二:使用“export?format and xlsx”编辑URL: https://docs.google.com/spreadsheets/d/19285912859128591859-LIFFM/export?format=xlsx

Finally click in "Get Data From Web" in Excel and past that URL above.最后点击 Excel 和上面的 URL 中的“从 Web 获取数据”。 That it's all you need.这就是你所需要的。 If you need more info, just ask.如果您需要更多信息,请询问。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM