Here's my dilemma, I need to parse a series of 606 weeks worth of Billboard 200 charts for the position of 36 different albums. Here's what I've got so far...
https://docs.google.com/file/d/0B_tgNfDq0kXAakR5eHZ3bzJQVkk/edit?usp=sharing
Billboard just redid their website, so now Excel's webquery returns a very pretty and clean table. I created two formulas in columns A and B of my worksheet, A has the list of relevant dates (specifically every Saturday from 8/18/2001 until this week), and B makes hyperlinks to the charts based on the dates. The rest of the chart is color-coded for the benefit of my advisors, who will also be reviewing the sheet.
我还手动将日期为 2001-08-18 的第一个图表通过网络查询到了它自己的工作表中。此工作表尚未被触及 - 它正是 web 查询返回的内容。
如您所见,该表跨越到 G 列,每个条目占用 3 行。我的重点是 C 列和 D 列。每个条目的 D 列行是(从上到下)标题、艺术家和印记|标签。每个条目的 C 列的第一行包含该周从 1 到 200 的位置。出现的模式是每 3 行以 4 开头(所以 7、10、13...)包含一个位置和专辑标题(col C & D, resp.),并且每个以 5 开头的第 3 个单元格包含一个艺术家。
我将尝试用简单的英语解释我的想象,但请注意,这可能会惨遭失败。
So the macro would take two cells as input (can they even take input?), album title and corresponding artist. This input should tell the macro both the string stored in each cell and the location - e.g, E1, C2 - of said cell. The macro should loop through each URL in column A from row 3 to 608, querying the URL into a new sheet. This new sheet should be made active, and then every 3rd row starting with 4 should be searched sequentially for the album title string. Upon finding a match, the cell one row beneath the matching query cell should be compared to the artist name string. Should both strings match the content of their corresponding query cells, the number (from 1 to 200) in column C and the same row as the matching album title cell should be copied to the cell in the 'bb200' sheet corresponding to the URL queried and the album title searched. The loop should now recur on the next URL in the sequence. In the event no match is found (the album didn't chart that week, or BB returned a wonky table), the corresponding cell should be left blank. The macro should exit once the list of URLs is exhausted.
我的问题是双重的:首先,我对宏观的思考过程从根本上说是合理的吗?其次,但最重要的是,我什至不知道从哪里开始在 VBA 中编写它。我研究过 Java、C 和最近的 C++(特别是 OpenGL)。我对 VBA 语法和 API 完全不熟悉,坦率地说,我在这方面的时间太短了,无法坐下来正式学习这门语言。在此之后,我计划在短期内完成这项工作,但这项任务是在星期一完成的,我不知道它最终会有多大的规模。
为了记录,宏不是任务,但要收集的数据对于完成它是不可或缺的。对那些好奇的人来说,任务是在星期一之前完成我的毕业论文的完整草稿。这些数据将用于创建我的顾问指示我在写作中包含的几个图表。论文本身已经基于在网站外阅读每张专辑的销售业绩而编写。
你会帮助我超越,因为大多数其他应届毕业生都在提交一些严重不成熟的图形表示。唯一一个走到这一步的学生发明了一种仪器并提供了原理图和 AutoCAD 图纸。然而,我离题了。
在此先感谢您的帮助!!