Showing posts with label VBA. Show all posts
Showing posts with label VBA. Show all posts
雖然我自己本身在學習Excel時,都是詢問朋友以及Google大師,不過偶爾還會去書籍翻翻看看有哪些不錯,這篇大概整理並分類了幾本推薦的書。

今天早上突然想到 Excel 中 Sum 或者其他基本函數中,有些引數的數量其實不固定,那如果要在自定義的 Function 中要怎麼使用?
於是就整理在這兒了 ( ̄ー ̄)

Just a note, enjoy it!

Function,所謂的自訂函數。
在Function裡寫入自己想要的功能,而後在工作表(Sheet)裡就能自由運用該函數。

接下來的範例,在Function裡寫入可以抓取該模組(Module)裡全域變數的相關程式碼,就可以在工作表(Sheet)裡使用。



1. First, you should include the component "Micrsofost ActiveX Data Objects # Library"  from  Tools > Reference. (# means version number)

2. And then, use the follow code to connect the DB and you can use the data from the assigned DB.
(The following example code I write with Access 2010, also you can write with other Microsoft Office production.)