ªð¦^¦Cªí ¤W¤@¥DÃD µo©«

excel 2007/2010¶}±Òexcel 2003½s¿èªºvba¬Û®e©Ê°ÝÃD

excel 2007/2010¶}±Òexcel 2003½s¿èªºvba¬Û®e©Ê°ÝÃD

­ì¥»¬O¦b2003Àô¹Ò¤U¼¶¼gªº
¶]°_¨Ó¨S°ÝÃD
¦ý¬O¤µ¤Ñ±NÀɮײ¾¦Ü¥t¤@¥x¹q¸£¥Hexcel 2010¶}±Ò®É¥X²{¿ù»~
¥H2007¶}±Ò¥ç¦P
" °õ¦æ¶¥¬q¿ù»~:'1004':
   À³¥Îµ{¦¡©Îª«¥ó©w¸q¤Wªº¿ù»~ "
µo¥Í¿ù»~ªºµ{¦¡½X¬°
Workbooks("Trading.xls").Sheets("DataSource").Range("J" & Rows.Count).End(xlUp).Row
¸g¹L´ú¸Õ¤§«á
µo²{À³¸Ó¬O¦]¬°¦³¨ä¥¦¬¡­¶Ã¯¶}°_©Ò­P(¥»¨Ò¤¤¬O¨Ó¦Û©ó¥ý«e¨Ï¥Î¤Fapplication.workbooks.add)
¦b­ì¥»2003¤U
workbooks("Trading.xls")·|±qTrading.xls³o­ÓÀɮתº¤u§@ªí"DataSource"¨ú±oÀx¦s®æ¸ê®Æ
¦ý¬O¨ì¤F2007/2010«hµLªk
¥H¤U¬O§Úªº±À´ú:
´ú¸Õ¤@¬qµ{¦¡½X
  1. Sub s()
  2. MsgBox Workbooks("Trading.xls").Sheets("DataSource").Range("J" & Rows.Count).End(xlUp).Row
  3. MsgBox CStr(Workbooks("Trading.xls").Sheets("DataSource").Cells(2, 10))
  4. End Sub
½Æ»s¥N½X
¥i¥H°õ¦æ¨Ã¦^³ø¥¿½T¸ê®Æ
¦ý­YActiveWorkbook ¤£¬O Trading.xls®É «hµo¥Í¿ù»~
¹³¬O¥t¥~¶}±Ò¤@­ÓEXCELÀÉ(¦^¨ì­ì¥ýÀɮסA·s¼W¬¡­¶Ã¯®É¡AActiveWorkbook·|Åܦ¨·s¼Wªº¬¡­¶Ã¯)
·Q½Ð°Ý¦¹¬Û®e©Ê°ÝÃD(§Ú²qªº¹ï¶Ü?)¤Î¸Ñ¨M¿ìªk
·P¿E¤£ºÉ!! ¤£µM¥u¦n§ä2003¨ÓÄé¤F....

¥»©«³Ì«á¥Ñ Hsieh ©ó 2012-8-5 07:07 ½s¿è

¦^´_ 1# lalalada
§Úª©¥»¬O2003 ¤§«e©Ò¦^Âе{¦¡¤¤¦³.Rows.Count ¦b 2007 2010 ¤¤°õ¦æ¤]¬O·|¥X¿ù
«ü©ú¤u§@ªí ¸Õ¸Õ¬Ý¥i§_¸Ñ¨M
  1. Option Explicit
  2. Sub Ex()
  3.     With Workbooks("Trading.xls").Sheets ("DataSource")
  4.         MsgBox .Range("J" & .Rows.Count).End(xlUp).Row
  5.         MsgBox CStr(.Cells(2, 10))
  6.     End With
  7. End Sub
½Æ»s¥N½X

TOP

¦^´_ 2# GBKEE

·PÁª©¤j!
³o¬qµ{¦¡½X¸g´ú¸Õ«á¥i¥H¨Ï¥Î
¥i¬O§Ú¤£À´³o¸ò­ì¥»ªº®t§O¦b­þ...? ¬°¤°»ò³o¼Ë´N¥i¥H
©Ò¥H2007¥H«áªºª©¥»¤£¯à¨Ï¥Îworkbooks(index)¤èªk¤Þ¤J¸ê®Æ¶Ü...."

TOP

¦^´_ 3# lalalada
2007¥H¤Wªº    Rows.Count   (ROWS ¬Oª«¥ó)
³o´N¦p ¤u§@ªí¼Ò²Õ Code (µ{¦¡½X) ¤¤ªº RANGE  (ª«¥ó¦WºÙ) ¦p¨S«ü¦W¤u§@ªí¦WºÙ
·í§@¥Î¤¤ªº¤u§@ªí  ¤£¬O¤u§@ªí¼Ò²Õ ªº¤u§@ªí ·|¥X¿ù¤@¼Ëªº

©Ò¥H2007¥H«áªºª©¥»¤£¯à¨Ï¥Îworkbooks(index)¤èªk¤Þ¤J¸ê®Æ¶Ü...."   
¦b  workbooks(1) ªºCODE(µ{¦¡½X)¤¤  Msgbox   workbooks(2).Name ¸Õ¸Õ¬Ý

TOP

¥»©«³Ì«á¥Ñ lalalada ©ó 2012-8-5 15:43 ½s¿è

¦^´_ 4# GBKEE

·PÁª©¤j!
´ú¸Õ msgbox workbooks(2).name ·|¥¢±Ñ
¥u¦³ msgbox workbooks(1).name ¥i¥H
§Ú·QÀ³¸Ó¤£¬Orowªº°ÝÃD
«á¨Ó¬d¨ì¤F³o­Ó http://support.microsoft.com/kb/928283/zh-tw
¨Ì·Ó¨ä«ü¥Ü¥[¤J Application.DefaultSaveFormat = xlWorkbookNormal
³ºµM´N¥i¥H¥Î¤F= =
¦ý¤£¬O«ÜÀ´µo¥Í¤°»ò¨Æ´N¬O¤F
¤j·§¸ò2007¤§«áÅܦ¨xlsm/xlsx¦³Ãö?
¦Ó¥B¦b2007¤§«á·|µo²{¥i¥H¶}¥X¨â­Ó¥H¤WªºVBA½s¿è¾¹
¥t¥~§Úµo²{¦b2007¤¤ ¨Ï¥Î.SaveAs¤èªk¦n¹³µLªkÀx¦sÀɮצ¨.xlsm/.xlsx

TOP

        ÀR«ä¦Û¦b : °µ¦n¨Æ¤£¯à¤Ö§Ú¤@¤H¡A°µÃa¨Æ¤£¯à¦h§Ú¤@¤H¡C
ªð¦^¦Cªí ¤W¤@¥DÃD