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

[µo°Ý] ¦p¦ó°µ ¸ê®Æ/ÅçÃÒ ?

½Ð°Ý¦³¤°»ò¿ìªk¥i¥H§PÂ_Àx¦s®æ¤@©w­n¿é¤J­È

½Ð°Ý¦³¤°»ò¿ìªk¥i¥H§PÂ_¡A·í§Ú A2 ¿é¤J©m¦W®É¡AA5, A7 (Á|¨Ò) Àx¦s®æ¤@©w­n¿é¤J­È¡A¤£¯à¯d¤UªÅ¥Õ¡C
¬d¤F¦n¤[¡A§Ú¯à°µ¨ìªº´N¬O§PÂ_¡A¦ý¬O¨S¿ìªk±j¨î A5, A7¤@©w­n¿é¤J­È¡A¤£µM´N¨S¿ìªk©¹¤U¿é¤J
¦³ª¾¹Dªº¤H¡A¥i¥H¤À¨É¶Ü?¡AÁÂ.

TOP

¨Ï¥Îvba¦p¤U

Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As Boolean)
X = Sheet1.Range("A2")
Y = Sheet1.Range("A5")
Z = Sheet1.Range("A7")
If Not (X = "" Or X = " ") And (Y = "" Or Y = " ") Then
   MsgBox "A2¦³¤º®e-A5¤@©w­n¿é¤J¤º®e:§_«hµLªk¦sÀÉ"
End If
If Not (X = "" Or X = " ") And (Z = "" Or Z = " ") Then
   MsgBox "A2¦³¤º®e-A7¤@©w­n¿é¤J¤º®e:§_«hµLªk¦sÀÉ"
End If
End Sub
ù

TOP

¸Õ¸Õ¬Ý:
  1. Private Sub Worksheet_Change(ByVal Target As Range)
  2. Dim Rng As Range, E

  3. '³]©w[A2],[A4:A5],[A7](Á|¨Ò,¥i¼W´î)¤@©w­n¿é¤J­È
  4. Set Rng = Union([A2], [A4:A5], [A7])

  5. '¥Ø«e¾ã±iWorksheet¥ô¦ó¦a¤è¦³²§°Ê, §¡·|IJ°Ê¥»VBA.
  6. '¦p·QÁY¤pIJ°Ê½d³ò¬°[A2],[A4:A5],[A7],½Ð±N¤U¦C«e­±¤§¤@ºJ¡u'¡v¥h±¼
  7. 'If Intersect(Target, Rng) Is Nothing Then Exit Sub
  8. If [A2] <> "" And Application.CountA(Rng) < Rng.Count Then
  9.     For Each E In Rng
  10.        If E = "" Then
  11.            MsgBox E.Address & " ¤@©w­n¿é¤J¤º®e, ¤£¯à¯d¤UªÅ¥Õ¡C"
  12.        End If
  13.     Next
  14. End If
  15. End Sub
½Æ»s¥N½X

TOP

¦^´_ 1# aweihsu

¸ê®Æ/ÅçÃÒ
    play.gif
¾Ç®üµL²P_¤£®¢¤U°Ý

TOP

¥»©«³Ì«á¥Ñ lpk187 ©ó 2016-3-8 15:17 ½s¿è

¦^´_ 1# aweihsu
·í²Ä¤G¦C¦³¿é¤J­È·|°±¯d¦b²Ä5¦C¡A¦Ó·í²Ä2¦C©M²Ä5¦C¦³­È®É¡A«h°±¯d¦b²Ä7¦C¡A²Ä5¦C©M²Ä7¦C¥¼¿é¤J­È«hÂI¿ï¨ä¥LÀx¦s®æ«á³£·|¸õ¦^¥¼¿é¤J­Èªº²Ä5¦C©Î²Ä7¦C
  1. Option Explicit

  2. Private Sub Worksheet_SelectionChange(ByVal Target As Range)
  3.     Dim Rng As Range, Col%
  4.     For Each Rng In Target
  5.         Col = Cells(2, Columns.Count).End(xlToLeft).Column
  6.         If Cells(2, Col) <> "" Then
  7.             If Cells(5, Col) = "" Then
  8.                 Cells(5, Col).Select
  9.                 Exit For
  10.             ElseIf Cells(7, Col) = "" Then
  11.                 Cells(7, Col).Select
  12.                 Exit For
  13.             End If
  14.         End If
  15.     Next
  16. End Sub

  17. Private Sub ­×§ï¼Ò¦¡_Click()
  18.     Application.EnableEvents = False
  19. End Sub

  20. Private Sub ¿é¤J¼Ò¦¡_Click()
  21. Application.EnableEvents = True
  22. End Sub
½Æ»s¥N½X

TOP

¦^´_ 4# Hsieh
ÅãµMª©¤j ¸ê®Æ/ÅçÃÒ ªº¤èªk¬O³Ì¨Î¸Ñ¨M¤è®×,
¦ý¤p§Ì¥\¤O¤Ó®t, ¸Õ¤F¥b¤Ñ, ÁÙ¬O§@¤£¥X ¸ê®Æ/ÅçÃÒ ªº¤èªk,
ÁٽЪ©¤j¶i¤@¨B«ü¾É, ÁÂÁÂ!!

TOP

[µo°Ý] ¦p¦ó°µ ¸ê®Æ/ÅçÃÒ ?

¦p¦ó°µ¥X ¦p Hsieh ¤j¤j©Ò¨q¥Xªº
http://forum.twbts.com/thread-16562-1-1.html
4# ¸ê®Æ/ÅçÃÒ ?

¦^´_ 6# yen956


    play.gif
¾Ç®üµL²P_¤£®¢¤U°Ý

TOP

¦^´_ 8# Hsieh
ÁÂÁÂHsiehª©¤jªº¦^ÂлP«ü¾É,
­ì¨Ó[A2]Åçµý¤½¦¡¬O
=countblank(A5:A7)<>0
ÁÂÁÂ!!

TOP

A5, A7¤@©w­n¿é¤J­È¡A¤£µM´N¨S¿ìªk©¹¤U¿é¤J

©¹­þ­Ó®æ¿é¤J¡H¡H¡H
¥i§_¤W¶Çªí®æ¡I¡I¡I

TOP

        ÀR«ä¦Û¦b : ¦Y­W¤F­W¡B­WºÉ¤Ü¨Ó¡A¨ÉºÖ¤FºÖ¡BºÖºÉ´d¨Ó¡C
ªð¦^¦Cªí ¤W¤@¥DÃD