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

¦p¦ó§Q¥ÎVBA¨Ó¹F¨ì "³sµ²" ®ÄªG?

¦p¦ó§Q¥ÎVBA¨Ó¹F¨ì "³sµ²" ®ÄªG?

°ÝÃD
¦p¦ó§Q¥ÎVBA¨Ó¹F¨ì "³sµ²" ®ÄªG?

¸Ô²Ó°ÝÃD¤º®e
¨Ï¥ÎÀɪº¤u§@ªía ©M ­×§ïÀɪº¤u§@ªíA¡A¤º®e¬O§¹¥þ¤@¼Ò¤@¼Ë¡A
¦]¬°¬O§Q¥Î='C:\Documents and Settings\®à­±\§Q¥ÎVBA§ó·s³sµ²\­×§ï¸ê®Æ§¨\[­×§ïÀÉ.xls]¤u§@ªíA'!A1
ªº¤½¦¡¨Ó³sµ²¨â­Ó¤£¦P¸ô®|ªº¬¡­¶Ã¯¤u§@ªí¤º®e¡A
¤£ª¾¦³¨S¿ìªk§ï§Q¥ÎVBA¨Ó¹F¨ì³oºØ®ÄªG¡A(VBA¸Ì­±½ÐÀ°§Úµù©ú­×§ï¸ô®|ªº¦a¤è)¡A
§Ú·Q­n¥´¶}¬¡­¶Ã¯´N·|¦Û°Ê§ó·s­×§ïÀɪº³sµ²¤º®e¦Ó¶Ç¨ì¨Ï¥ÎÀÉ¡F
¥t¥~¦pªG¨S¦³¤º®e¡A¥i¥H¤£­nÅã¥Ü0¦Ó¬Oºû«ùªÅ¥Õ¶Ü?

¥t¥~¦pªG¹³¬O¤u§@ªíB & b¡A¦³­­¨î½d³òªºÅª¨ú¨Ó·½¡AVBA¤S¸Ó¦p¦ó¼g©O?

¥H¤W°ÝÃD¡A½Ð¤j¤j«ü±ÐÀ°¸Ñ¤F¡IÁÂÁ¡I

¤U¸ü»¡©úÀÉ
¦p¦ó§Q¥ÎVBA§ó·s³sµ².rar (9.36 KB)

¦^´_ 21# ­ã´£³¡ªL


   ÁÂÁ­ã¤j«ü±Ð¡A¦³®É¶¡ªº¸Üªº½T¦Û¤v´ú¸Õ»·¤ñ¶K¤W¦¬Ã¬ªº¦h¡A¤]«Ü¸r¼}§A­Ì¯à¥Î±M·~´À¥L¤H¸Ñµª¡A³o¬O§Ú­Ì·s¤â§V¤Oªº¥Ø¼Ð¡A¦A¦¸ÁÂÁ¸ÑÃD¡C

TOP

¦^´_ 20# RCRG


Set xB = Workbooks.Open(xFile, ReadOnly:=True)
xB.Sheets("¤u§@ªíA").Protect "123"
With MyB.Sheets("¤u§@ªía")
¡@¡@.Unprotect "123"
¡@¡@xB.Sheets("¤u§@ªíA").[A1:H500].Copy .[A1]
¡@¡@.Protect "123"
End With
¡@
xB.Sheets("¤u§@ªíB").Protect "123"
With MyB.Sheets("¤u§@ªíb")
¡@¡@.Unprotect "123"
¡@¡@xB.Sheets("¤u§@ªíB").[AA1:AB20].Copy .[AA1]
¡@¡@.Protect "123"
End With
xB.Close 0

¬JµM¤wª¾»yªk¡A¬°¦ó¤£¦Û¤v¥h¸Õ§@¡H
³oVBA´N¬O­n¦Û¤v°Ê¤â¥h¸Õ§@¡A±q¿ù»~¤¤¥h­×¥h§ï¡A¤~¯à¤F¸Ñ¨ä¾÷¨î¡A
¥u¥Î°Ý¨Óªºª½±µ¥h¶K¥Î¡A¥Ã»·¾Ç¤£¤F¡I¡I¡I

TOP

¦^´_ 19# ­ã´£³¡ªL


    ­ì¨Ó¦p¦¹¡A"¤£¤@©w¬O¥Ø¼ÐÀɩΨӭìÀÉ" ³o¥y´£¿ô¤F§Ú;

¨º¥i¥H§ïÀ°§Ú¼g¦¨¶K¤W¥Ø¼ÐÀÉ«e¡A¥ý¸Ñ¶}¥Ø¼ÐÀɪº«OÅ@¡A¦A¶K¤W¥Ø¼ÐÀÉ¡A³Ì«á¦A«ì´_¥Ø¼ÐÀɪº«OÅ@¶Ü?

TOP

¦^´_ 18# RCRG


¢°¡D¥ý¥h§Ë²M·¡¡@ActiveSheet¡@¬O¤°»ò·N«ä¡H¡@¡@¡e·í«e¤u§@ªí¡f¡A¥¦¤£¤@©w¥Nªí¬O¨Ó·½ªí©Î¥Ø¼Ðªí
¢±¡D½Æ»s®É¡A¨Ó·½ªíÀ³¬O«OÅ@¡A¥Ø¼Ðªí¬O¥¼«OÅ@¡A¤~¯à¥¿±`°µ¡e¶K¤W¡f¡A
¡@¡@¥i¥ý¤â°Ê¥h°µ¤@¦¸¡e½Æ»s¡D¶K¤W¡f¸Õ¸Õ´Nª¾¹D
¡@

TOP

¦^´_ 17# ­ã´£³¡ªL


    ¦pªG¨Ó·½ÀÉ( ­×§ïÀÉ)»P¥Ø¼ÐÀÉ(¨Ï¥ÎÀÉ)³£³Q«OÅ@µÛ¡A¨º»òVBA§Ú¦Û¤v§ï¦¨¦p¤U¡A¦ý¥Î°_¨Ó·Pı¦³ÂI©Ç©Çªº¡A¦n¹³¦³®É·|½Æ»s¦¨¥\¡A¦³®É·|¨S½Æ»s¨ì¡A¬O¨º¨à¦³°ÝÃD¶Ü?

Private Sub Workbook_Open()
Dim MyB As Workbook, xB As Workbook, xFile$
Set MyB = ThisWorkbook
xFile = ThisWorkbook.Path & "\­×§ï¸ê®Æ§¨\­×§ïÀÉ.xls"  '¸ô®|ÀɦW¦Û¦æ­×§ï
Application.ScreenUpdating = False
Set xB = Workbooks.Open(xFile, ReadOnly:=True)

ActiveSheet.Unprotect "123" '¥ý¨ú®ø«OÅ@

xB.Sheets("¤u§@ªíA").[A1:H500].Copy MyB.Sheets("¤u§@ªía").[A1]
xB.Sheets("¤u§@ªíB").[AA1:AB20].Copy MyB.Sheets("¤u§@ªíb").[AA1]
xB.Close 0

ActiveSheet.Protect "123" '­«·s³]©w«OÅ@
End Sub

TOP

¦^´_ 16# RCRG


«ö¶s¦³¤H·|©ñ¦b¸ê®Æ°Ï¶Ü¡H

¥i¥ý±N¨Ó·½¤u§@ªí³]¬°«OÅ@¡A¶K¦n«á¦A¸Ñ°£«OÅ@¡]«ö¶s¶·³]¬°¡ÐÂê©w¡^
With xB.Sheets("¤u§@ªíA")
      .Protect
      .[A1:H500].Copy MyB.Sheets("¤u§@ªía").[A1]
      .UnProtect
End With

TOP

¦^´_ 14# ­ã´£³¡ªL

©Ò¥H­ã¤jªºVBA¬O®M¥Î ½Æ»s¶K¤W ªº¤èªkÅo?

¨º§Ú·Q¤F¸Ñ¸Ô²ÓªºVBA¤º®e¬O 1. ½Æ»s¨Ó·½ª½±µ¶K¤WÂл\¥Ø¼Ð
                                         ÁÙ¬O    2. ½Æ»s¨Ó·½¡A²M°£¥Ø¼Ð¤º®e¡A¦A¶K¤W¥Ø¼Ð

¬O­þºØ¼Ò¦¡©O? ¦]¬°¦pªG¬O²Ä1­Ó¼Ò¦¡¡A¨º¥Ø¼Ð¥»¨Ó¦³VBA«ö¶s¡A¬O¤£¬O´NµLªkÂл\VBA«ö¶s¤F
¦]¬°­ã¤jªºvba¦pªG¨Ó·½¦³vba«ö¶s¦n¹³¤]·|¤@¨Ö½Æ»s¡A©Ò¥H¤£ª¾¹D·|¤£·|¨C¶}Àɤ@¦¸´N½Æ»s¶K¤W¶V¨Ó¶V¦h«ö¶s¹L¥h

TOP

¦^´_  ML089


    ¬°¤°»ò§Ú½d³ò¦Û¤v§ï¦¨¦p¤U¡AVBAÁÙ¬O·|¸õ¥X°ÝÃDµøµ¡©O

'VBAµ{¦¡©ñ¦b ¨Ï¥ÎÀÉ.XLS¤¤ ...
RCRG µoªí©ó 2016-1-25 12:22


¦^´_ 13# ML089

§Ú¤j·§§ä¨ì°ÝÃD©Ò¦b¤F¡A¦n¹³¬O­n§â²£¥Íªº°}¦C¤½¦¡¾ã­Ó²¾°£¡A¤~·|¥¿±`¡F
¤]´N¬O»¡¨Ï¥ÎÀɸ̡A¤£¯à¦³¸ò¤W¤@¦¸¤£¦P³sµ²ªº°}¦C¤½¦¡¡A¦³ªº¸Ü»Ý¥þ³¡²¾°£¡AÅý¥L±qªÅ¥Õ­¶¤¤¦A¶]·sªº³sµ²¥X¨Ó¡A¤~¤£­Pµo¥Í²§±`¡C
¥H¤W¬O§Ú¨Ï¥ÎM¤jª©ªº¤ß±o¡A¤]«D±`ÁÂÁ±z²Ä¤@®É¶¡¬°§Ú¸Ñµª¡C

TOP

½Æ»s¤º®e§t®æ¦¡¤Îµù¸Ñ, ¨S¤°»ò¤è«Kªk, ¦Ñ¹ê¥Î½Æ»s¶K¤W§a!!

Private Sub Workbook_Open()
Dim MyB As Workbook, xB As Workbook, xFile$
Set MyB = ThisWorkbook
xFile = ThisWorkbook.Path & "\­×§ï¸ê®Æ§¨\­×§ïÀÉ.xls"  '¸ô®|ÀɦW¦Û¦æ­×§ï
Application.ScreenUpdating = False
Set xB = Workbooks.Open(xFile, ReadOnly:=True)
xB.Sheets("¤u§@ªíA").[A1:H500].Copy MyB.Sheets("¤u§@ªía").[A1]
xB.Sheets("¤u§@ªíB").[AA1:AB20].Copy MyB.Sheets("¤u§@ªíb").[AA1]
xB.Close 0
End Sub

¨Ó·½Àɤâ°Ê¶}±Ò¦³¦h§Ö, ³oµ{¦¡´N¤@¼Ëªº§Ö, ¤Ï¤§¥çµM~~

TOP

        ÀR«ä¦Û¦b : ¤Hªº¤ß¦a¬O¤@²¥¥Ð¡A¤g¦a¨S¦³¼½¤U¦nºØ¤l¡A¤]ªø¤£¥X¦nªºªG¹ê¡C -
ªð¦^¦Cªí ¤W¤@¥DÃD