Excel VBA需要的最好的例子 [英] Best short examples of the need for Excel VBA

查看:127
本文介绍了Excel VBA需要的最好的例子的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这是Joel的一个...

Here's one for Joel...

我正在寻找向Excel用户演示的方式(没有编程经验)如何学习一些Excel VBA可以使他们使用Excel的生活更容易一些。

I am looking for ways to demonstrate to an Excel user (with no programming experience) how learning some Excel VBA can make their life working with Excel a little easier.

第一个想法是使用一个例子来复制电子表格的手动调整,例如所有数据的单击条件格式化。例如:根据用户输入阈值加上所有的红色,橙色或绿色数字,加上一些其他派生数据,如当前的商业周。

First thoughts are to use an example that replicates manual tweaking of a spreadsheet, such as one click conditional formatting of all the data. For example: highlighting all the numbers red, orange or green according to user input thresholds coupled with some other derived data such as current business week.

我希望这样一个简单的VBA示例不应该太难以掌握以前从未写过一行代码的人,希望能够尝试学习一些Excel VBA。

I am hoping that such a short VBA example should not be too difficult to grasp for someone who has never written a line of code before, and hopefully make a case for trying to learn a bit of Excel VBA.

然而,在这个例子中,编写代码所花费的时间并不比在Excel中手动应用条件格式快得多。所以我有兴趣知道社区中有没有任何更优雅的例子展示使用Excel VBA的优点。

However, with this example the time taken to code it is not significantly quicker than applying the conditional formatting manually in Excel. So I would be interested to know if anyone in the community has any more elegant examples that demonstrate the advantages of using Excel VBA.

理想的例子有以下特点: / p>

Ideal examples would have the following characteristics:


  1. 节省大量时间(大T,其中T =手动过程/代码时间)。

  2. <
  3. 结束不能轻易实现的结果

  4. 可实现具有短暂的基本VBA代码。

  1. Significant time savings (large T, where T = time for manual procedure / time to code).
  2. Non-abstract, everyday spreadsheet examples.
  3. End results that can not be easily achieved manually.
  4. Achievable with short, basic VBA code.

请记住,目标受众正在采取他们的第一步编程。

Bear in mind that the target audience is taking their first steps into programming.

推荐答案

如果可以,请观看他们使用Excel半小时,你会发现完美的机会。当他们打开一个电子表格时,自动调整所有的列,将col A格式化为日期,右对齐col J,删除第2行到第5行,并将打印方向更改为横向,然后找到获胜者。让他们再做一次,但是使用宏记录器。然后重播宏记录器。

If you can, watch them use Excel for a 1/2 hour and you'll find the perfect opportunity. When they open that one spreadsheet, autofit all the columns, format col A as a date, right justify col J, delete rows 2 through 5, and change the print orientation to landscape then you've found a winner. Have them do it again, but with the macro recorder on. Then replay the macro recorder.

通过使用他们在现实生活中使用的东西,它将产生更多的影响。

By working with something they use in real life, it will have more impact.

你不必每天半小时保存他们的第一枪。在他们使用的东西上保存他们30秒的苦差,他们将开始考虑他们想要自动化的所有东西。根据我的经验,他们会过得很快。在任何时候,他们都希望Excel能够填写一个网页表单,导入信息,并获得咖啡。

You don't have to save them 1/2 hour a day with the first shot. Save them 30 seconds of drudgery on something they'll use and they'll start thinking of all the things they want automated. In my experience, they'll go overboard rather quickly. In no time, they'll want Excel to go fill out a web form, import the information, and get them a coffee.

这篇关于Excel VBA需要的最好的例子的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆