本文介绍了Excel文件和Visual Basic的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我以前从未使用过Visual Basic,但可以使用从哪里开始的指针.

I have never used Visual Basic before but could do with a pointer on where to begin.

我有750个excel电子表格,其中包含大量不同类型的数据.列始终相同,但每个电子表格的数据行数不同.我需要提取数据并将其放入两个新的电子表格中.

I have 750 excel spreadsheets that contains various amounts of data of different types. The columns are always the same, but the number of data rows vary per spreadsheet. I need to extract data and put it into two new spreadsheets.

显然,手动执行750次操作将是一场噩梦.我只想运行一个可以为我做的脚本,因此想起了Visual Basic,尽管我以前从未使用过它.

Obviously to do this 750 times manually would be a nightmare. I just want to run a script that can do it for me and thus thought of Visual Basic although i've never used it before.

我的具体问题是:

  1. 我应该研究哪种类型的命令,使我可以将数据复制到行号开始的地方(因为上面的数据在任何行数中都不一样).在此新数据之前有一个标题-如何获取它以搜索此标题,然后选择下面的行?
  2. 我所有的电子表格都必须放在一个文件夹中,以便脚本可以遍历它们吗?或者我也可以在该文件夹中使用某种文件夹结构吗?
  3. 有人推荐我任何好的资源来掌握视觉基础并掌握我需要做什么吗?

谢谢

汤姆

推荐答案

因此,随着MS PowerQuery的引入,编译任务变得更加容易.如果您使用的是MS Excel 2013,则已经具有此功能.如果不是,请您应该下载它并使用MS中的扩展名.

So the compilation task got easier with the introduction of MS PowerQuery. If you are using MS Excel 2013, you already have this. If no, you should download it and use the extension from MS.

以下指南概述了如何使用强大的查询将多个Excel文件中的数据合并到一个表中.这意味着,借助Power Query(PQ),MS只需单击几下即可进行并启用了轻松聚合. PQ是许多以前需要VBA的任务的轻型替代方案.

The following guide outlines how to Using Power Query to Combine Data from Multiple Excel Files into One Table. This means that with Power Query (PQ), MS has taken and enabled easy aggregation using a few simple button clicks. PQ is a lightweight alternative to a lot of tasks that used to require VBA.

在此示例中,您将使用PQ指向价值通常格式化的Excel文件的整个文件夹(应该没有问题750).唯一的限制是每个数据文件都应具有一个名称相似的标签.

In this example, you will use PQ to point to an entire folder (750 should be no problem) worth of commonly formatted Excel files. The only limitation is that each data file should have a similarly named tab.

我不会重复该指南的详细内容,因为它是深入而直观的.但是,如果遇到问题,请保持联系.

I won't repeat the details of the guide for how to do it, as it is in-depth and visual. But if you run into issues, get in touch.

这篇关于Excel文件和Visual Basic的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-03 07:46