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

[µo°Ý] ¦p¦ó³]©wMsgBox¦^¶Ç­È vbCancel Åý¥L¤£­n¸õ¥X¸ß°Ý¬O§_­n¦sÀÉ

[µo°Ý] ¦p¦ó³]©wMsgBox¦^¶Ç­È vbCancel Åý¥L¤£­n¸õ¥X¸ß°Ý¬O§_­n¦sÀÉ

vbCancel ¤£³]©w~¨ÌµM·|¸õ¥X¸ß°Ý¬O§_­n¦sÀÉ
§Ú¸Ó¦p¦ó³]©wÅý¥L¤£¸õ¥X¦¹¸ß°Ýµøµ¡~¦^¨ì­ì¨Óµe­±©O?

¦^´_ 1# av8d


Application.DisplayAlerts = False '´£¥Üµøµ¡®ø¥¢

  ¦h°µ¦h·Q¦h¾Ç²ß¡A¤Ö¬Ý¤Ö¿ù¤Ö°g³~

  ¦h°µ=¦h¦h½m²ß¡A¦h¦h½s¼g¡C
  ¦h·Q=·Q·Q¬°¤°»ò¤H®aµ{¦¡­n¨º¼Ë¼g¡A¦pªG´«¦¨¦Û¤v¡A¤S·|«ç¼g¡C
  ¦h¾Ç²ß=¾Ç²ß¤H®aªºµo°Ý¨Ã¸Ñµª¡A¾Ç²ß¤H®aªº¼gªk

  ¤Ö¬Ý=¥u¬Ý¤£°µ¤]ªPµM

TOP

¦^´_ 2# mark15jill


    ½Ð°Ý¦pªG¤£·QÅý¥L±N¾ã­ÓExcelÃö³¬~¥u³æ¯ÂÃö³¬MsgBoxµøµ¡~¤]¤£»Ý­n¸ß°Ý¬O§_¦sÀÉ~¬O§_¦³¿ìªk? ·P®¦!

TOP

¦^´_ 3# av8d


    MsgBoxµøµ¡¬O³]­pªÌ¬°¤FÅý¨Ï¥ÎªÌ¦³¿ï¾Ü¾÷·|©Ò³]­p¡A¬°¦ó­n¨ú®ø¦¡µ¡¸õ¥X?
µo°Ý½Ð²M·¡´y­z»Ý¨D©Î¤W²î§¹¾ãÀɮשε{¦¡½X¡A§_«h½M¤lºN¶H±o¤£¨ì¥¿½T¸Ñµª
¾Ç®üµL²P_¤£®¢¤U°Ý

TOP

¦^´_ 3# av8d


³o¬O©¿²¤´£¥Üµøµ¡
¤£¬OÃö³¬EXCEL ...0.0
¦Ü©ó  ³]©wMsgBox ¦^¶Ç­ÈVbCancel . ¦ý¤S¤£­nÅã¥Ü
°£«D¦³³]©w¨ì ¦Û°ÊÀx¦s ©ÎªÌ¬O °õ¦æ§¹ ª½±µ¥ýÀx¦s
¤£µM¤@¯ë ¦Ó¨¥ À³¸Ó¤£·|¥X²{¬O§_­n¦sÀÉ...(¯S®í±¡ªp°£¥~   ¦p µ{¦¡Àú±¼  µ{¦¡¤º¹w³]´N¦³Àx¦s

  ¦h°µ¦h·Q¦h¾Ç²ß¡A¤Ö¬Ý¤Ö¿ù¤Ö°g³~

  ¦h°µ=¦h¦h½m²ß¡A¦h¦h½s¼g¡C
  ¦h·Q=·Q·Q¬°¤°»ò¤H®aµ{¦¡­n¨º¼Ë¼g¡A¦pªG´«¦¨¦Û¤v¡A¤S·|«ç¼g¡C
  ¦h¾Ç²ß=¾Ç²ß¤H®aªºµo°Ý¨Ã¸Ñµª¡A¾Ç²ß¤H®aªº¼gªk

  ¤Ö¬Ý=¥u¬Ý¤£°µ¤]ªPµM

TOP

¦^´_ 3# av8d
Ãö³¬MsgBoxµøµ¡~¤]¤£»Ý­n¸ß°Ý¬O§_¦sÀÉ
¨º§A»Ý©ú½T¦a§i¶DExcelµ{¦¡ ÀÉ®×Ãö³¬«á¬O­n¦sÀɩΤ£¦sÀÉ
  1. Option Explicit
  2. Private Sub Workbook_BeforeClose(Cancel As Boolean)
  3. Me.Close
  4. 'Me.Save '¤w¦sÀɤ§ÀɮצsÀÉ
  5. 'Me.Close False '¤£¦sÀÉ
  6. 'Me.Close True, "D:\TEST.XLS"  '¥¼¦sÀɤ§ÀɮצsÀÉ ©Î¤w¦sÀɤ§ÀÉ®×¥t¦sÀɦW
  7. End Sub
½Æ»s¥N½X

TOP

¦^´_ 6# GBKEE


   ¤j¤j~§Úªº·N«ä¬O~¸õ¥X¸ß°Ýµøµ¡¤@¯ë«D¬° ¬O . §_ . ¨ú®ø  ¤TºØ

¥¿±`¤Hªº·Qªk¬O~«ö¨ú®ø¥Nªí§Ú¨S°µ¹L³o­Ó°Ê§@~©Ò¥HÃö³¬MsgBox¦Ó¤w~
¦ý¬O¨t²ÎÀq»{¨ú®øµL½×¦³µL©w¸q~³£¬Oª½±µÃö³¬Excel~¦pªG¦³Åܧó¥L·|¸ß°Ý¬O§_Åܧó~¦pªG¨SÅܧó«h·|ª½±µÃö³¬~

§Ú§Æ±æ¤£­nÃö³¬Excel~¥u­n§âMsgBoxªº´£¥Ü°T®§Ãö³¬´N¦n~¥i¬O¨t²ÎÁ`¬Oª½±µÃö³¬Excel

TOP

¦^´_ 7# av8d
  1. Option Explicit
  2. Private Sub Workbook_BeforeClose(Cancel As Boolean) 'Cancel->¨ú®ø=True ¤£Ãö³¬ÀÉ®×
  3.    If MsgBox("­n¦sÀɶÜ?", vbYesNoCancel) = vbCancel Then Cancel = True
  4. End Sub
½Æ»s¥N½X

TOP

        ÀR«ä¦Û¦b : ¤f»¡¦n¸Ü¡B¤ß·Q¦n·N¡B¨­¦æ¦n¨Æ¡C
ªð¦^¦Cªí ¤W¤@¥DÃD