2012年12月28日星期五

Access中国/Office中国不打开EXCEL文件的前提下读取数据的方法之一access教程,access文章,access培训,access下载,access破解,access技巧,access源码,access实例,access数据库,access开发,access软件,ACCESS学习,access应用 - Powered by Discuz!

Access中国/Office中国不打开EXCEL文件的前提下读取数据的方法之一access教程,access文章,access培训,access下载,access破解,access技巧,access源码,access实例,access数据库,access开发,access软件,ACCESS学习,access应用 - Powered by Discuz!


比如读取D:\税金.xls中sheet1中A1:B20的数据

dim i as integer

application.screenupdating=false

for i=1 to 20

activesheet.cells(i,1).formula="='D:\[税金.xls]sheet1'!$A$" & i

activesheet.cells(i,2).formula="='D:\[税金.xls]sheet1'!$B$" & i

next i

activesheet.range("a1").currentregion.copy

activesheet.range("a1").PasteSpecial xlPasteValues

Application.CutCopyMode = False

application.screenupdating=true
运行一下后,发现比打开、读取、关闭的操作快多了,特与大家分享。

Code Modules And Code Names

Code Modules And Code Names


Code Modules
A common mistake among new VBA programmers is that they put their code in the wrong module.  When this happens, Excel can't find the code, and it can't be executed.  This page describes the different types of modules in Excel VBA, and what you should and shouldn't put in each type.  Much of this information is specific to Excel97 and 2000, and may not apply to Excel5 or Excel95. 
In Excel VBA, there are four main types of modules: 
  • Standard Code Modules, which contain custom macros and functions,
  • Workbook And Sheet Code Modules, which contain event procedures for the workbook, and worksheets and chart sheets,
  • User Forms, which contain code for the controls on a UserForm object, 
  • Class Modules, which contain Property Let, Get, and Set procedures for Objects that you create.
It matters very much where you put your code. 
NOTE: I must add, for the sake of accuracy, that the Sheet modules, the ThisWorkbook module, and the Userform modules are all really just different flavors of Class Modules.  You can create Property Get/Let/Set procedures, and methods and functions (and events) in these classes, just as you can for "standard" class modules.  Various techniques for using your forms and sheets as classes will be described in the "Advanced Form Techniques" page, coming to a server near you very soon. 

Standard Code Modules, also called simply Code Modules or just Modules, are where you put most of your VBA code.  Your basic macros and your custom function (User Defined Functions) should be in these modules.  For the novice programmer, all your code will be in standard modules.   In addition to your basic procedures, the code modules should contain any Declare statements to external functions (Windows APIs or other DLLs), and custom Data Structures defined with the Type statement.  
Your workbook's VBA Project can contain as many standard code modules as you want.  This makes it easy to split your procedure into different modules for organization and ease of maintenance.  For example, you could put all your database procedures in a module named DataBase, and all your mathematical procedures in another module called Math.  As long as a procedure isn't declared with the Private keyword, or the module isn't marked as private, you can call any procedure in any module from any other module without doing anything special.  
Workbook And Sheet Modules are special modules tied directly to the Workbook object and to each Sheet object.   The module for the workbook is called ThisWorkbook, and each Sheet module has the same name as the sheet that it is part of.   These modules should contain the event procedures for the object, and that's all.  If you put the event procedures in a standard code module, Excel won't find them, so they won't be executed.  And if  you put ordinary procedures in a workbook or sheet module, you won't be able to call them without fully qualifying the reference.  
User Form Modules are part of the UserForm object, and contain the event procedures for the controls on that form.  For example, the Click event for a command button on a UserForm is stored in that UserForm's code module.  Like workbook and sheet modules, you should put only event procedures for the UserForm controls in this module.  
Class Modules are used to create new objects.  Class modules aren't discussed here, except to say that a class module is used to handle Application Event Procedures.  

Code Names
Workbook and sheet modules have a property called CodeName, which is how the object is know internally to VBA.  By default, the workbook code name is ThisWorkbook, and each sheet module is Sheet1, Sheet2, etc for Worksheets, or Chart1, Chart2, etc for ChartSheets.   You can use these names in your VBA code as you would normal variables.  For example
Msgbox ThisWorkbook.Nameor
Msgbox Sheet1.Name 
This is useful so that you can always refer to a worksheet, for example, even if the user renames the sheet from Excel.  For example, if you have a sheet called "Sheet1", both its name and code name will be Sheet1.  But if the user renames the sheet to MySheet, the code 
Msgbox Worksheets("Sheet1").Name 
will fail, because there is no longer a sheet named Sheet1.  However, the code 
Msgbox Sheet1.Name 
will continue to work, because VBA still knows that worksheet by its code name of Sheet1. 
You can change the code name of either the ThisWorkbook or a Sheet object.  If you do this once you already have code in these modules, you can run into problems, so only do this if you 1) know what you're doing, and 2) need to do this.  To change the code name of a module, select the module in the Project Explorer window, and the open the Properties Windows (F4 or from the View menu), and change the Name property.  If you change the code name of the ThisWorkbook object, ThisWorkbook will continue to refer to the workbook object.  For example, if you change the code name of the ThisWorkbook object to MyWorkbook, both of the following lines of code will work: 
Msgbox ThisWorkbook.Name
Msgbox MyWorkbook.Name
However, if you change the code name for the Sheet1 object to MySheet, the following code will fail
Msgbox Sheet1.Name
because there is no longer a sheet object with a code name of Sheet1. 
Moreover, you can change the code name of an object with a VBA procedure.  However, this can lead to many problems, so again, don't do it unless you know what you're doing and you really need to do this.  To change the code name of sheet with a code name of Sheet1 to NewCodeName, use 
ThisWorkbook.VBProject.VBComponents("Sheet2").Name= "NewCodeName"
You can change the code name of the ThisWorkbook object to "NewWBName" with 
ThisWorkbook.VBProject.VBComponents("ThisWorkbook").Name = "NewWBName"
Just to make things more complicated, when you change the code name of the ThisWorkbook object, and you're using the VBA Extensibility library procedures, the code 
Msgbox ThisWorkbook.Name
will continue to work, but 
Msgbox ThisWorkbook.VBProject.VBComponents("ThisWorkbook").Name
will fail, because there is no object with a code name ThisWorkbook.  
In general, changing code names is not for the casual user.   For more information about programming the VBA components, see Programming To The VBE

How Do I move a Spreadsheet to a New Instance of Excel - Page 2

How Do I move a Spreadsheet to a New Instance of Excel - Page 2



Sub NewInstance()
    Dim sCurFile As String
    sCurFile = ActiveWorkbook.FullName
    ActiveWorkbook.Close
    Set objExcel = CreateObject("Excel.Application")
    objExcel.Visible = True
    objExcel.Workbooks.Open (sCurFile)
End Sub

Multiple Excel Files Open on Multiple Tabs, Instead of One Tab - Microsoft Community

Multiple Excel Files Open on Multiple Tabs, Instead of One Tab - Microsoft Community

Another option is to right-click the Excel taskbar button and to select Microsoft Office Excel 2010 from the popup menu.

If you want to view workbooks on two screens, you'll have to start two separate instances of Excel. Start Excel, then Shift+click the Excel icon on the Windows taskbar to open a second instance, and drag the new window to the other screen (if it is maximized, un-maximize the window first).

web

http://iask.sina.com.cn/u/2763276865/ish

2012年12月27日星期四

休士頓的六品烘焙館 - Helen 在德州 - Yahoo!奇摩部落格

休士頓的六品烘焙館 - Helen 在德州 - Yahoo!奇摩部落格


休士頓的六品烘焙館

分類:生活情報
2010/03/13 18:50

愛吃台灣式麵包的Helen, 在DALLAS地區總是很難得到滿足! 少數幾家麵包店所賣的麵包種類, 還停留在台灣20年前的老式口味. 每次我回台灣一趟, 吃了台灣的麵包後, 就益發覺得此地的麵包"乏善可陳"!
去年, 在休士頓發現了一家很棒的麵包店, "六品西點麵包", 位於百利大道上的頂好超市廣場. 麵包種類多又好吃, 生意超好, 東西絕對新鮮. 於是, 每當我們去休士頓祭拜老爸的時候, 總會順便買一大拖拉庫的麵包回來, 解解饞! 
別看這家小小的店面, 每次我們光顧時, 總是顧客大排長龍, 我們在休士頓只停留一晚, 總要在第一天到達時就先去預定第二天取的麵包. 而這次, 依舊生意興隆, 但是架上麵包所剩無幾. 一問之下, 原來他們開了新店面, 中央廚房設在那裡, 烘焙好的麵包送過來老店賣. 既然如此, 我們就乾脆去新店逛逛, 看是否有較多的選擇!
新店位於越華超市廣場, 那是個嶄新的購物廣場, 看看"六品"的新門面!
走進有著大片落地窗的店面, 明亮寬敞潔淨! 面積約為老店的兩倍! 我們到的時候已經傍晚, 架上的廟包不多了.
冷藏櫥櫃裡的蛋糕, 造型可愛.


也有鳳梨酥
店長Theresa知道我們是遠自DALLAS來光顧, 很熱心的介紹我們一些比較特別口味的麵包. 我們約定第二天早上去買, 大老遠花5小時車程才到休士頓一趟, 不多買些好像對不起自己!  老弟甚至還多買些打算分給好友! 我們兩人買了好多好多......., 都是剛出爐的!
我們第二天到的時候, 還是早了些, 好多麵包才剛出爐, 還沒上架! 店長親切熱心的介紹我們一些比較特別的麵包. 這是椰子葡萄乾麵包, 對我來說雖不是新產品, 但是..........它可真大啊! 長度超過20公分!
這個造型特別的是"芋頭番薯麵包". 好大一個!
切開來看, 一頭有番薯內餡.
另一頭有芋頭內餡, 真是好吃! 麵包鬆軟, 內餡不會太甜, 都很真材實料!
這是我們每次一定買的小倉麵包, 也就是紅豆麵包啦! 能買到都要碰運氣, 太早去的話, 剛出爐, 還沒法從模子剝下來, 去晚了又可能買不到. 我們總是前一天預定. 這麵包也是鬆軟好吃, 有紅豆顆粒, 也有紅豆沙在裡頭! 同樣也是不會太甜, 適合我們的口味!
這是店長推薦的 - 芋頭麵包, 造型特別!
內餡是鬆軟好吃的芋泥, 喜歡吃芋泥的朋友一定要試試, 保證你喜歡!
這是紅豆麻糬, 外表看來普通, 但是內有麻糬, 口感就很特別了!
這是老媽喜歡的大蒜起士麵包, 內有HAM薄片, 是鹹的口味!
這也是店長替別推薦的 - 戚風藍莓葡萄乾. 光是外型就特別!
剝開來, 見到好多好多藍莓內餡.........., 嗯! 好吃極了!

我和老弟倆人, 這也拿, 那也捨不得放棄, 選購的麵包裝了三個大箱, 帶回去DALLAS可以分送給同樣愛吃麵包的老妹, 和朋友!
喜歡吃麵包的朋友, 如果有機會到休士頓, 可千萬別忘了到"六品烘焙館"去看看, 相信你不會空手而歸的!
新店: 8388 W Sam Houston Suite 184    Houston TX 77072    電話: 281-776-0168
老店: 9384 Ballaire Bivd.  Houston TX 77038    電話: 713-773-0658

2012年9月30日星期日

丰富你的聊天技巧,让美女和你一起不再感觉枯燥!屌丝们都来看 - 未名空间(mitbbs.com)

丰富你的聊天技巧,让美女和你一起不再感觉枯燥!屌丝们都来看 - 未名空间(mitbbs.com)


有没有这种时候?在QQ上,你跟一个女孩聊天,你很想跟她的聊天投入且轻松,希望有一种你们之间说不完的话的感觉,可是不知道怎么搞的,你发现你们好像有时候没有什么太多的话可以说,聊天好像变的很干。于是你有点着急,拼命想找到话题,但是好像使不上力气。
请你先看下面的这段对话,看看这下面的这段对话,是否有一种似曾相似的感觉。
女孩:你干嘛呢
男: 上网听歌啊
女孩:哦
男:那你呢?干嘛呢?
女孩:呵呵,瞎逛
男:恩…那你等下呢?
女孩:继续看吧
男:哦….那你看什么呢?
女:(继续回答)
男:(继续问)
……反复多次后,男的问题终于感觉问题似乎问穷尽了…..于是…
男:哦
女:呵呵
有没有过上面这种对话?一直反复说:哦,呵呵之类的。如果你没有你就不用继续往下看了,这也许说明你的聊天和对话技能是丰富多彩的。如果反复出现或偶尔出现上述这种对话的朋友,请继续往下看。
这该肿么办?肿么聊天总是这么枯燥,总是永远离不开一问一答,然后就是“哦”“呵呵”之类的话?其实关键问题不在于你没有什么话题之类的,关键在于,“一问一答”的节奏上。请看下面的对话:
女:干嘛呢?
男:吓我跳,怎么这个时候在上线
女:没有呀,刚回来
男:刚上网就蹦出来了,我还以为你一上来就想我了,干嘛去了
女:(表情) 恩,我今天出去哪里哪里
男:哦哦哦。我今天哪都没去,就在网上找了个博彩网玩玩虚拟的百家乐游戏
女:?怎么了?
男:你干嘛呢在
女:听你讲话啊
男:哦,是这样的(然后大致描绘一下,再继续引出简单话题)
有没有感觉很不一样了?没错,这里面最大的不一样就是,不像机械式的一问一答。虽然里面还是有问答的成分在,但是明显感觉轻松和丰富一些了。也许有人说:是,我明显感觉到这不一样了,但是是不是你根据你的主观意愿瞎JB编的咧?为嘛有时候我主动跟别人说话,别人就是呵呵,哦之类的?
这个例子里面涉及到一个很关键的不同,那就是这些对话都是女孩在起头,对吗?都有这个共同点。因为女孩起头和你主动起头那将会是两个不同的概念。如果是你自己起头,你无法判断对方是否有空,是否愿意跟你聊。但是女孩主动起头的情景下,你至少可以确定一点,她有空,她想到你了,她愿意找你聊,甚至说,她也许有点点无聊。明白了吗?
像刚刚的那种对话,通常发生在这样的女孩身上:对你有点印象,然后愿意跟你聊,同时由于她自己也许有点小姿色,有一点小骄傲,所以不愿意一直追问别人问题或主动制造话题跟你聊。
所以,你一定要在这个时候懂得把握机会,千万不要错失了这种含量很高的潜在机会,你把握住了,你就是在创造更进一步的机会。
从心理学的角度来说:如果你经常觉得跟一个人没话讲,动不动就“哦。呵呵。”你会很自然而然的觉得,你们之间也许并不是一个世界的,并不投缘。但是,你如果跟一个人能轻松的畅聊,你会很容易就觉得,你跟这个人投缘,然后进一步YY,我们或许是天生一对也不一定呢。这其实就是一种印象分,或许你们两个是有很多地方不同,但是你们能彼此交流,交流的很愉快,这会加深好印象,然后这种好的感觉,对方会联想到“也许”我们很有缘分。
“懂得把握机会,其实就是在为自己创造更多机会。”